Learning resourcesReviewed · Perplexity

Perplexity Agent API: Fetch URL Content

This guide teaches developers to fetch known web pages through Perplexity’s Agent API, but retrieval can fail or return incomplete text. It explains fetch_url configuration, extracted-content responses, failure markers, URL limits and invocation pricing.

Researched 15 Nov 2026

In short.

This guide helps developers integrate known-page fetching into Perplexity’s Agent API, but a completed response can still contain unavailable or incomplete source content. It documents fetch_url parameters, response fields, failure markers and a price of $0.50 per 1,000 invocations plus model-token charges. Its overview examples omit a target URL and display web-search results, which limits their usefulness as fetch demonstrations. No code or API requests were executed; extraction quality, latency and operational reliability remain unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete page at [https://docs.perplexity.ai/docs/agent-api/tools/fetch-url-content.md], including embedded examples, access-control notices, error handling, limits and pricing. Linked documentation-index, pricing, API-reference, search-tool and third-party pages are excluded. No code or API requests were executed. Linked destinations, runtime behavior, extraction quality and current compatibility were not independently assessed.

The overview

Identity

Fetch URL Content is Perplexity’s documentation for the fetch_url tool in its Agent API. It explains how a model can retrieve content from URLs an application already knows, such as a specific article, document or report.

The source is the complete documentation page at [https://docs.perplexity.ai/docs/agent-api/tools/fetch-url-content.md].

Assessment

The guide is useful for understanding configuration, response inspection and retrieval failures. Its clearest practical contribution is explaining that successful completion of an Agent API response does not guarantee successful access to every requested page.

The overview example needs correction before it can serve as a complete fetch demonstration. The page also leaves extraction completeness, performance and several integration requirements unspecified.

Users

The guide suits developers building assistants that summarize or answer questions about sources supplied by a user or application. Beginners receive Python, TypeScript and cURL examples; experienced developers receive response fields, invocation accounting and failure-handling details.

It is most relevant when the source URL is already known. Finding suitable sources first is the separate web_search use case described on the page.

Capabilities

The documented tool fetches URLs and extracts text for the model to use in an answer. A fetch_url_results output item can contain each requested URL, its page title and an extracted snippet.

The optional max_urls parameter accepts integers from 1 to 10 and limits URLs per tool call. Redirects are followed when the destination can be fetched, but the returned URL field preserves the requested address.

Using it

Requirements

The cURL example authenticates with a Perplexity API key in a bearer authorization header. The Python and TypeScript examples use Perplexity client libraries. Requests specify a model, input and tools.

Usable target addresses must be absolute HTTP or HTTPS URLs. Other schemes are unsupported. The page does not establish SDK or runtime versions, installation steps, the supported model list, account eligibility or request-rate quotas.

Mechanism

Adding a tools entry whose type is fetch_url makes fetching available during an Agent API request. Retrieved text supplies context for the model’s final answer. The documented output can place fetch_url_results before the assistant message.

Each item in fetch_url_results.contents must be inspected: a snippet can contain extracted text or a failure marker. When an upstream result is missing, the API adds a marker containing no_result_returned. Usage can record the invocation count under tool_calls_details.fetch_url.invocation.

Setup

The page shows client.responses.create in Python and TypeScript, with type set to fetch_url inside the tools array. It also shows an authenticated HTTP request to [https://api.perplexity.ai/v1/agent].

For the intended known-source workflow, include the actual target URL in the input and ask the model to fetch it before summarizing. Set max_urls explicitly when a bounded fetch count matters. The default value is not stated.

Example

An illustrative document-summary request would include the document’s URL, enable fetch_url with max_urls set to 1, and ask for a summary that identifies unavailable content. This is an adaptation of the documented fields, with no observed execution result.

The supplied overview examples ask for an explanation of Bayesian inference without providing any URL. Their displayed response contains search_results and a search_web invocation. That response does not demonstrate fetch_url operation. A separate schematic response illustrates the intended fetch_url_results structure.

Assessment & evidence

Limitations

Retrieval is best-effort. HTTP errors, robots-policy blocks, rate limiting, timeouts and unreachable addresses can prevent useful extraction while the overall response still completes.

Long pages may be truncated into snippets. PDFs, binary downloads and anti-bot challenge pages may yield limited or unrelated text. No extraction-size threshold, complete-document guarantee or measured latency is provided. The response also does not expose the final redirect destination in its URL field.

Practical implications

A practical implication of the documented response behavior is that a finished summary cannot establish that the whole source was available. Applications need to distinguish extracted content from failure markers and account for possible truncation.

The approach fits questions about a chosen source when the returned text contains the relevant material. For tasks requiring exhaustive document coverage, the page provides no basis to assume that fetching a long document supplies its complete contents.

Alternatives

The page recommends web_search for discovering relevant pages, researching broad topics and obtaining snippets from multiple sources. It recommends fetch_url when the application already knows which source to inspect.

It also suggests combining search with fetching: discover pages first, then retrieve the most relevant URLs for fuller context. Comparative extraction quality, speed and cost against other services or local tools are not assessed.

Evidence

The evidence consists of Perplexity’s documentation: its overview, SDK and HTTP examples, response structures, error descriptions, limits and stated pricing. The large overview response illustrates web search; the smaller response example illustrates the claimed fetch output structure.

These are documentation examples. No code or API requests were executed, and no independent evidence establishes retrieval reliability, answer accuracy or performance.

Access & freshness

Costs

The page lists fetch_url at $0.50 per 1,000 invocations, equivalent to $0.0005 per invocation. Model-token usage is billed separately. The stated billing unit is an invocation; the page does not establish that each Agent API request produces exactly one invocation.

Total task cost is unknown without model-token rates, token consumption and invocation counts. The overview response’s $0.03988 total and $0.0025 tool charge accompany search_web usage and cannot establish the cost of a fetch_url request.

Rights

The supplied page contains no explicit licence or redistribution grant for the documentation or retrieved source material. Applicable service terms and rights to reuse fetched content are not established here.

The tool explicitly does not bypass paywalls or login walls. Access restrictions can produce failure markers.

Freshness

The documentation snapshot was captured on 15 November 2026. The page supplies no explicit publication or revision date.

Timestamps and last_updated fields inside the sample response concern example data and referenced sources; they do not establish when this documentation or feature changed. API compatibility and pricing after the capture date are unknown.

Actions

Before integration, confirm current authentication, model support and SDK requirements. Supply a real source URL, choose an explicit max_urls value and allow for both invocation charges and model-token costs.

Inspect the result for every expected URL. Treat failure markers, including no_result_returned, as unavailable content, and make answers acknowledge missing material. If source identity matters, verify redirect destinations separately. Check whether relevant text was truncated before relying on a summary for complete coverage.

Evidence for this report

selected-page.txtselected · checked 2026-11-15