Skip to main content
Photo of DeepakNess DeepakNess

Claude brings web fetch tool to the API

Unproofread notes

Now, you can search live on the internet when using the Claude API, because Anthropic has brought the new web fetch tool which can search for relevant information online, in the background, and then return the output.

The web fetch tool is currently in beta. To enable it, use the beta header web-fetch-2025-09-10 in your API requests.

And here's the example code provided that you can use to use the web-fetch tool:

curl https://api.anthropic.com/v1/messages \
    --header "x-api-key: $ANTHROPIC_API_KEY" \
    --header "anthropic-version: 2023-06-01" \
    --header "anthropic-beta: web-fetch-2025-09-10" \
    --header "content-type: application/json" \
    --data '{
        "model": "claude-opus-4-1-20250805",
        "max_tokens": 1024,
        "messages": [
            {
                "role": "user",
                "content": "Please analyze the content at https://example.com/article"
            }
        ],
        "tools": [{
            "type": "web_fetch_20250910",
            "name": "web_fetch",
            "max_uses": 5
        }]
    }'

You have to pass the web-fetch in the API request and it works in the background and gives you the output, as you can see in the example above.

Comment via email