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

Include Options

Control which Fetch artifacts are returned.

Include options control which artifacts a Fetch returns: Markdown, State JSON, Appendix, page metadata, links, raw HTML, screenshots, summaries, and response metadata.

Start with the default. Add include options only when the task needs more context, a different artifact, or a narrower search corpus.

curl https://api.expand.ai/v1/fetch \
  -H "x-expand-api-key: $EXPAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "include": { "markdown": true, "json": true }
  }'

Do not turn everything on by default. Fetch is designed to return the useful working context first, then keep deeper evidence reachable when the task needs it.

Jump to: · · ·

Output Model
Highlights
Browser Behavior
API Reference

Which surface am I using?

Include works differently depending on where you call Fetch. Pick the surface, then read its rules.

SurfaceWhat it controls
Body includeAPI and SDK output artifacts: Markdown, State JSON, Appendix, page metadata, links, HTML, screenshots, summaries, and response metadata.
Markdown ?include=Markdown document parcels only: statejson and appendix.
MCP flagsAgent-facing booleans such as includeJson, includeAppendix, and .

Start with the default

Most requests should start with the default Fetch output. It gives the agent the main working document and preserves enough structure to answer more questions without flooding context.

Add options deliberately:

  • Use the default for first-pass reading, summarization, extraction, and agent browsing.
  • Add State JSON when frontend state, embedded JSON, or network data may answer questions Markdown cannot.
  • Add Appendix when navigation, sidebars, related links, footers, or secondary regions matter.
  • Add links when the application needs link inventories rather than prose.
  • Add html only when the integration needs raw source.
  • Add screenshot when visual inspection or debugging matters.
  • Add response when HTTP status, final URL, redirects, or headers matter.

More output is not automatically better output. A larger response costs context and rarely improves the answer.

Include options matrix

State JSON is the product name; the request field is json. meta is page metadata; response is response metadata.

OptionProduct meaningDefault / common behaviorUse whenLink deeper
markdownMain Markdown working documentAdded when omitted for normal FetchThe agent needs readable page contentOutput Model

State JSON is core signal, not just an overflow reference, and Appendix is secondary context that is available when needed, not evidence-only.

Body include

Body include asks Fetch to return specific artifacts from the capture. Use it when your application needs structured control over the response. It is the main control surface for the API and SDKs.

{
  "url": "https://example.com",
  "include": {
    "markdown": true,
    "json": true,
    "appendix": true,
    "meta"




A few options take nested configuration:

  • links can be configured for filtered link extraction, such as same-domain filtering and include/exclude patterns.
  • screenshot.fullPage controls whether screenshot capture is full-page. See Browser Behavior and the API Reference for exact capture defaults.
  • response.includeHeaders includes response headers.

See the API Reference for exact nested schemas and field-level defaults.

Markdown include parameter

Markdown ?include= controls document parcels, not every Fetch artifact. It only decides whether statejson and appendix are appended to the Markdown document.

/v1/fetch
-> Markdown + frontmatter + default State JSON

/v1/fetch?include=
-> Markdown + frontmatter only

/v1/fetch?include=appendix
-> Markdown + frontmatter + Appendix

/v1/fetch?include=appendix,statejson
-> Markdown + frontmatter + Appendix + State JSON

Rules to remember:

  • Use the canonical token statejson in URLs. stateJson, state-json, and state_json may work as aliases, but examples should use statejson.
  • Unknown tokens are ignored.
  • include=appendix does not also include State JSON unless statejson is listed.
  • Empty include= is a deliberate opt-out of extra document parcels.

The Markdown document is assembled as parcels:

Markdown document
  frontmatter
  Main Markdown
  + statejson?
  + appendix?

JSON Mode and mixed includes

JSON Mode is the same capture split into fields. Body include controls requested artifacts, while the URL ?include= parameter still controls Markdown document parcels such as Appendix and State JSON.

Avoid mixing body include and URL ?include= casually. If you need precise behavior, pick one documented surface for the thing you are controlling and verify the output shape in JSON Mode.

Highlights corpus

When Highlights searches a Fetch, include options choose the corpus. They are not just display toggles.

  • Markdown is a searchable corpus source.
  • State JSON is a searchable corpus source.
  • Appendix is a searchable corpus source when included.
  • If search is present and no include is provided, Fetch defaults to Markdown plus State JSON.
  • A request with no searchable corpus is rejected.
{
  "url": "https://example.com",
  "search": {
    "query": "pricing table limits"
  },
  "include": {
    "markdown": true,
    "json": 


The selected corpus flows into ranked results:

Markdown + State JSON + Appendix
        |
        v
Highlights corpus
        |
        v
ranked snippets + citations

See Highlights for queries, ranking, snippets, scores, citations, and searching an existing snapshotId. To inspect a citation back to its exact source block, see Playground & Replay.

MCP include flags

MCP uses agent-friendly booleans instead of the full body include object.

MCP toolInclude flags
fetchincludeMeta, includeAppendix, includeJson
fetch_searchincludeMarkdown, includeAppendix, includeJson

What the flags mean:

  • includeJson means State JSON.
  • includeAppendix means Appendix.
  • includeMeta means page metadata on fetch.
  • includeMarkdown controls whether fetch_search searches stored Markdown.

MCP defaults are chosen for agent usefulness, not to mirror every raw API default. For setup, see Agent Quickstarts; for exact tool schemas, see MCP Tools & Resources.

CLI behavior

The CLI is optimized for the common Fetch path. expandai fetch does not currently expose a public --include flag.

  • Use expandai fetch <url> for the common path.
  • Use --format json when you need the JSON output shape.
  • Use --search, --max-results, and --min-score for CLI Highlights behavior.
  • Use the API, SDKs, or MCP when you need fine-grained include control.

When you need to choose individual artifacts, reach for body include rather than the CLI.

Batched Fetch limitations

Batched Fetch accepts shared include options at the start of a run, but the polling path cannot retroactively serve every artifact.

  • Batched Fetch covers common Markdown and metadata use cases.
  • Polling cannot serve screenshot, json, or appendix as retroactive include fields.
  • Highlights is not the Batched Fetch workflow.

See Batched Fetch for status, pagination, and lifecycle behavior.

Next steps

  • Output Model: understand the fields and layers each include option returns.
  • Highlights: search a capture once the corpus is selected.
  • Browser Behavior: screenshot and capture behavior.
  • Batched Fetch: include limits when fetching many URLs.
  • API Reference: exact schemas and nested include defaults.
PreviousOutput Model
NextBrowser Behavior

On This Page

Which surface am I using?Start with the defaultInclude options matrixBody includeMarkdown include parameterJSON Mode and mixed includesHighlights corpusMCP include flagsCLI behaviorBatched Fetch limitationsNext steps
includeMeta
CLICommon-path Fetch output. No public include flag today.
Batched FetchShared include options with narrower result support.
json
State JSON
Public include default false; MCP defaults true; search default includes it
Frontend state, network data, hidden JSON, or structured evidence matters
Output Model
appendixSecondary page regionsOff unless requestedRelated links, sidebars, navigation, references, or secondary context matterHow Fetch Works
metaPage metadataPublic include default trueTitle, URL, snapshot, page metadata, and request context matterOutput Model
responseHTTP response metadataHeaders are off unless response.includeHeaders is trueStatus, redirects, final URL, response metadata, or headers matterAPI Reference
linksExtracted linksOff unless requestedThe application needs link inventories or filtered link listsAPI Reference
htmlRaw HTMLOff unless requestedThe integration needs source HTML for its own parser or audit pathAPI Reference
screenshotVisual captureOff unless requestedVisual debugging, inspection, or screenshot artifacts matterBrowser Behavior
:
true
,
"response": {
"includeHeaders": true
}
}
}
true
,
"appendix": false
}
}