Skip to main content
The fetch endpoint extracts clean, structured content from a web page. You get the page title, description, full text, and metadata — without writing a scraper. It returns JSON by default, or LLM-ready markdown with format=context.

Parameters

JSON response

Fields like author, date, image, and site_name appear when the page provides them. For a research paper, abstract holds the paper’s complete abstract, with any maths written in LaTeX; description stays a short summary. metrics also says where the page came from: The cost_dollars values on this page are examples, not quoted prices. When the live page is gone or its site no longer answers, the fetch endpoint may return an archived copy instead. The response then says so: body_source is wayback, body_captured_at is when that copy was saved, and body_snapshot_url links to the copy itself. These fields are absent for a live page. If Andi already holds its own copy of the page, the fetch endpoint returns that copy.

Context format

With format=context, the response is markdown with YAML frontmatter — ready to pass into an LLM context window:
For a research paper, an abstract line (the paper’s complete abstract) takes the place of description when the page text does not already include it.

Using the query parameter

Pass a query to get passage-level extracts scoped to a specific question:
The response includes query_extracts (passages relevant to the query) and query_snippet (a query-focused summary). With a query and your own maxContentLength, a page longer than that limit is not cut to its opening. The body is the sections that answer the query instead, in page order, each run led by a [Section › Subsection] line, and truncated is true. Read it together with query_extracts, which holds the best passages (they are not repeated in the body). In JSON these sections are in content, as markdown, with no separate markdown field. A page that fits is returned whole.

Using the effort parameter

Pass effort to control how thoroughly the page is retrieved — the same tier names used by search modes:
low favors speed; max spends the most time extracting content, useful for pages that are slow to load or render content client-side. Omit effort to use the server’s adaptive default. Invalid values return a 400 listing the valid tiers.

Setting a spending cap

Pass maxCost to limit what a single fetch can cost, in US dollars, before any discount. Andi selects the most capable reading mode that fits within your cap, up to the mode you requested. The charge never exceeds the cap. If the returned text would exceed it, the text is cut and the response includes truncated: true. When the cap affects the result, metrics.limited_by_max_cost (JSON) or limited_by_max_cost: true (context frontmatter) is set to true. This flag appears only when you pass maxCost. It is true when the cap lowered the mode or cut the text. If the page cannot be read within the cap, the response is 422 with reason: "max_cost". A cap below the lowest accepted value returns 400 with reason: "max_cost_too_low" and minimum_cost_dollars, the lowest cap at current rates. There is no default cap.

Partial responses

A 200 response can include partial content when the page is slow to fully retrieve: Treat partial: true as incomplete — re-request the same URL after retry_after_seconds to get the full content. This differs from a 503, where no content was extracted at all.

Error handling

The fetch endpoint uses two distinct error codes for page-level failures: Other errors (400 for a missing or invalid URL, 401, 402, 429) follow the same patterns as the search endpoint — see error handling.

Pricing

See pricing. The charge is returned in metrics.cost_dollars (JSON), cost_dollars in the frontmatter (format=context), and the X-Andi-Cost-Dollars header.

Search extracts as an alternative

If you already have search results and want passage-level text without fetching each page, use extracts=true on the search endpoint instead. This returns text extracts inline on each result:
The fetch endpoint is for when you need the full page content, or when you want to retrieve a specific URL that may not appear in search results.

MCP tool

The andi_fetch_url MCP tool wraps this endpoint. See Build with AI agents for setup instructions.

Next steps

Search modes

Automatic effort by default, manual control when you want it.

Query parameters

Full parameter reference including extracts.

Response format

JSON and context format output structure.

Build with AI agents

MCP server and agent integration.