CLAUDE LABJP
OPUS — Claude Opus 4.7 is generally available, improving software engineering, long-running coding, and higher-resolution visionAPIKEY — You can now set an expiration on API keys in the Console, with email reminders before keys valid for 7+ days expireREFLECT — A monthly recap at Settings > Reflect shows your top topics, most active day, and peak hour (beta)M365 — The Microsoft 365 connector now supports write tools for email, calendar, and OneDrive/SharePoint filesCOWORK — Cowork expands to web and mobile, bringing Chat and Cowork into one shared home across devicesDESIGN — Claude Design, a new Anthropic Labs product, lets you co-create designs, prototypes, slides, and one-pagersOPUS — Claude Opus 4.7 is generally available, improving software engineering, long-running coding, and higher-resolution visionAPIKEY — You can now set an expiration on API keys in the Console, with email reminders before keys valid for 7+ days expireREFLECT — A monthly recap at Settings > Reflect shows your top topics, most active day, and peak hour (beta)M365 — The Microsoft 365 connector now supports write tools for email, calendar, and OneDrive/SharePoint filesCOWORK — Cowork expands to web and mobile, bringing Chat and Cowork into one shared home across devicesDESIGN — Claude Design, a new Anthropic Labs product, lets you co-create designs, prototypes, slides, and one-pagers
Articles/API & SDK
API & SDK/2026-06-15Intermediate

Letting Claude Read Live Pages: Implementing web_fetch Without the Footguns

How to pull the actual text of official pages and PDFs straight into Claude's context with the web_fetch tool. Covers the URL-validation rule that trips everyone up, the settings that keep token costs down, and why fetch errors arrive as HTTP 200 — based on what I hit running it in production.

Claude API115web_fetchserver toolscost controlautomation pipeline2

Premium Article

I asked a scheduled job to "summarize the latest changes in Claude Code in three lines," and what came back was a tidy summary of features from several months ago. The model answers from its training-time knowledge, so that was expected behavior. The real problem was that the stale summary nearly slipped into an article draft before anyone noticed.

Official changelog pages change almost weekly. If you let Claude read that page itself, the summary is always grounded in the current text. That is exactly what the web_fetch tool does. Unlike web search, it takes a URL you specify and pulls the full page (and PDFs) straight into context — a server-side tool that does the retrieval for you.

As an indie developer running several sites under Dolice Labs on autopilot, I added a "read the official source directly" step into the pipeline, and factual errors in generation dropped noticeably. Here is what actually tripped me up while wiring it in.

web_fetch and web_search play different roles

The first thing people conflate is the difference from web_search. web_search is for "run a query and gather candidates from across the web"; web_fetch is for "open one page you already know about and read all of it."

The rule of thumb is simple: if a URL is already in the context, fetch it; if you do not yet know the URL, search first. Claude chooses to fetch when:

  • A URL appears in a user message or a previous tool result
  • The user names a specific resource (an article, a README, a pricing page) and web_search is also enabled, so it can locate the page first

By contrast, an open-ended question like "what are best practices for REST API design?" will not trigger a fetch, because it does not point at a specific page. Knowing this boundary makes it much easier to debug the two classic mismatches: "I gave it a URL but it won't fetch" and "it keeps running a search instead."

Get it running with the smallest call first

The minimal setup in the Python SDK is surprisingly short. You add a single web_fetch entry to the tools array, and the model handles retrieval and reading on its side.

import anthropic
 
client = anthropic.Anthropic()
 
resp = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": "Summarize the key points of this page in three bullets: "
                       "https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-fetch-tool",
        }
    ],
    tools=[
        {
            "type": "web_fetch_20250910",
            "name": "web_fetch",
            "max_uses": 3,
        }
    ],
)
 
for block in resp.content:
    if block.type == "text":
        print(block.text)

Because the feature is in beta, some environments require the beta header web-fetch-2025-09-10. With a recent SDK, passing the tool definition alone may just work, but when you see an unsupported-style error, the header is the first thing to check.

Keep in mind that web_fetch is a server tool. Unlike a client tool, where you receive a tool_use, run it yourself, and return the result, the retrieval happens entirely on Anthropic's side. You write no HTTP request. In exchange, the responsibility for which URLs get read stays firmly on your side, as we'll see next.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
When to use web_fetch_20250910 vs web_fetch_20260209, from a minimal call to reading the response
The validation rule that a URL must already appear in the conversation, and how to build around it safely
Using max_content_tokens, allowed_domains and max_uses to cap both token cost and attack surface in production
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-07-13
Full-Size or Downscaled? A Per-Image Resolution Rule for Opus 4.7's High-Resolution Vision
Opus 4.7 finally read the fine texture in my wallpapers, so I sent everything at full size. My weekly image tokens jumped 2.4x. Here is the preflight that decides resolution and model per image, with the measured savings.
API & SDK2026-07-12
Designing Around Claude API 413 request too large — Preflight Sizing and Splitting
Pack too much text, images, and tool_result into one request and Claude API rejects it with 413 request too large. Here is a code-backed design for measuring request bytes before you send, telling the two kinds of 413 apart, and splitting requests without breaking them.
API & SDK2026-07-12
When You Give an API Key an Expiration Date, Expiry Becomes a Plan Instead of an Accident
The Console now lets you set expiration dates on API keys. Here is how to fold planned expiry into unattended operations — with overlapping dual keys and a local expiry ledger — so your nightly jobs never go dark.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →