Expand AI logo
DocsDocs
Glow Active
API Reference
Login

Documentation

Get Started

OverviewWhy ExpandQuickstartWays to Use Expand

Agent Quickstarts

OverviewExpand SkillClaude CodeCursorCodexOpenCodeSkill-Based AgentsOther MCP Clients

Fetch

OverviewHow Fetch WorksOutput ModelInclude OptionsBrowser BehaviorHighlightsPlayground & ReplayBatched Fetch

Reference

API ReferenceCLI CommandsMCP Tools & ResourcesTypeScript SDKPython SDK

Account & Billing

Pricing & UsageTiersFAQ

Machine-Readable Docs

start.mdllms.txtllms-full.txtDocs as Markdown
Browse docs

Get Started

OverviewWhy ExpandQuickstartWays to Use Expand

Agent Quickstarts

OverviewExpand SkillClaude CodeCursorCodexOpenCodeSkill-Based AgentsOther MCP Clients

Fetch

OverviewHow Fetch WorksOutput ModelInclude OptionsBrowser BehaviorHighlightsPlayground & ReplayBatched Fetch

Reference

API ReferenceCLI CommandsMCP Tools & ResourcesTypeScript SDKPython SDK

Account & Billing

Pricing & UsageTiersFAQ

Machine-Readable Docs

start.mdllms.txtllms-full.txtDocs as Markdown

How Fetch Works

Understand Main Markdown, State JSON, Appendix, Iris, Spatial Markdown, snapshots, and evidence.

Fetch renders the page, reads the visible content and structured state, then returns the useful working context first. When the task needs more, the output keeps stable references back to State JSON, Appendix, Highlights, citations, and replay.

Useful first, complete when needed.

Most extraction tools force a bad choice: return everything and waste context, or prune aggressively and lose evidence. Fetch takes a different path. It gives the agent a useful working document first, then keeps the rest addressable through stable references.

Keep everything

Complete, but expensive. Raw payloads, navigation, footers, duplicated UI, and low-signal text crowd out the answer.

Keep only main text

Concise, but lossy. Tables, icons, app state, links, and source evidence disappear when the agent needs the next step.

Fetch

Useful first, complete when needed. Main Markdown and compact State JSON carry the common case; references preserve depth.

See the Output Model

Map these product layers to the , , , and fields.

markdown
json
appendix
meta

Try a Fetch

Run one request and read the output for yourself.

Inspect in Playground

Open a snapshot, follow citations, and replay what Fetch saw.

A web page is more than text

Useful page context includes the visible article or product copy, but it also includes layout, tables, icons, app state, secondary regions, links, and source evidence. Plain HTML-to-Markdown converters usually flatten that into one stream. Fetch turns the page into layers an agent can reason about.

Main Markdown is the first thing the agent should read, not the only thing Fetch knows.

Useful first

Main Markdown is the readable working document. It is designed to answer the common case with fewer low-signal tokens, while preserving page structure that matters for reasoning.

State JSON is structured page and network state. It can answer questions Markdown alone cannot, especially when the page is backed by frontend data or API responses. It is part of the useful working context when it fits; when it is too large or better retrieved later, Fetch keeps references so the agent can ask for more.

Spatial Markdown keeps layout-sensitive information readable. Tables, pricing grids, comparison rows, icons, and visual affordances should not collapse into loose paragraphs when they carry meaning.

Frontmatter and metadata give the agent request and page context such as the source URL, title, capture metadata, snapshotId, and links to inspect deeper evidence. Exact fields belong in Output Model; this page is the mental model.

Complete when needed

Progressive disclosure is how Fetch stays compact without becoming lossy.

Less context does not mean less evidence. The default output gives the agent the likely answer path first, then leaves handles for the rest:

  • Appendix keeps secondary regions such as navigation, sidebars, footers, and link collections reachable without flooding the main document.
  • State JSON can be included directly when useful and can be referenced when it is too large for the main response.
  • Highlights searches captured Markdown, State JSON, and optional Appendix from a snapshotId.
  • Citations and evidence IDs point back to exact source material.
  • Playground and Replay make the same handles inspectable for humans.

This is why Fetch can help agents answer more questions with fewer tokens: it improves signal density instead of merely making pages shorter.

What Iris does

Iris is the part of Fetch that decides which page signals should become working context, structured state, spatial Markdown, or referenced evidence.

Iris is not an API field and it is not a separate product you configure. It is the product mechanism behind three jobs:

  • selecting useful State JSON;
  • preserving layout and icons as Spatial Markdown;
  • keeping evidence handles for source inspection.

The output layers

These are product layers, not exact response field names. For fields and schemas, use Output Model.

Read top to bottom, the output moves from the working document the agent reads first to the evidence it can reach for later. None of these layers is discarded; the lower ones stay addressable by reference.

Frontmatter, Main Markdown, and Spatial Markdown form the working document. State JSON and Appendix add structured state and secondary regions when they carry signal. Evidence handles, snapshotId, and Playground / Replay keep every claim traceable back to what Fetch saw.

Product terms map to current technical names in a few places:

  • Main Markdown maps to the public markdown field.
  • State JSON maps to json in current API fields and include options.
  • Highlights maps to technical surfaces such as /v1/fetch/search, fetch_search, and expandai search where exact names are required.
  • snapshotId is the public handle used for replay, evidence, and follow-up retrieval.

Why this helps agents

Fetch does not win by making pages shorter at any cost. It wins by improving signal density: the agent starts with the context most likely to answer the question, while deeper evidence stays recoverable.

That matters when an agent needs to:

  • answer from a clean document without paying for every repeated nav item;
  • keep tables, grids, icons, and product comparisons intact;
  • recover links and secondary regions without another page capture;
  • search a previous capture with Highlights instead of fetching again;
  • attach citations that users can inspect in Playground and Replay.

Next steps

  • Output Model: see the response fields and examples.
  • Quickstart: run one Fetch.
  • Playground & Replay: inspect evidence visually.
  • Fetch overview: return to the Fetch section.
PreviousOverview
NextOutput Model

On This Page

A web page is more than textUseful firstComplete when neededWhat Iris doesThe output layersWhy this helps agentsNext steps