Skip to main content

Overview

The fetch_url tool fetches and extracts content from specific URLs during an Agent API request. Use it when your application already knows which page, article, document, or report the model should inspect. Use fetch_url when you need full page content from known URLs. Use web_search when the model first needs to discover relevant pages.

When to Use

Combine web_search and fetch_url for multi-step research: search to find relevant pages, then fetch the most important URLs for fuller context.

Parameters

Response Shape

When fetch_url runs, the response can include a fetch_url_results output item before the final assistant message. Each fetched content item includes the URL, page title, and extracted snippet.

Error Handling

fetch_url is best-effort. When a URL cannot be fully fetched or extracted, the API can still return a completed Agent API response with the final assistant message explaining what content was available. Check the fetch_url_results.contents array to see which URLs produced extracted content.

Limits / Quotas

Use max_urls to keep fetches bounded and predictable. Fewer URLs usually produce lower latency and leave more context for the model’s reasoning and final answer.

Pricing

fetch_url is billed at $0.50 per 1,000 invocations. Model token usage is billed separately according to Agent API token pricing.
Pricing follows the same pattern as other tool calls: pay for tool invocations plus model tokens. See Pricing.

Next Steps

Web Search

Search the web before fetching source content.

Finance Search

Retrieve structured financial and market data.

People Search

Search for professionals and employees.

API Reference

View complete endpoint documentation.