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: · · ·
Include works differently depending on where you call Fetch. Pick the surface, then read its rules.
| Surface | What it controls |
|---|---|
Body include | API 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 flags | Agent-facing booleans such as includeJson, includeAppendix, and . |
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:
links when the application needs link inventories rather than prose.html only when the integration needs raw source.screenshot when visual inspection or debugging matters.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.
State JSON is the product name; the request field is json. meta is page metadata; response is response metadata.
| Option | Product meaning | Default / common behavior | Use when | Link deeper |
|---|---|---|---|---|
markdown | Main Markdown working document | Added when omitted for normal Fetch | The agent needs readable page content | Output 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 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= 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 JSONRules to remember:
statejson in URLs. stateJson, state-json, and state_json may work as aliases, but examples should use statejson.include=appendix does not also include State JSON unless statejson is listed.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 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.
When Highlights searches a Fetch, include options choose the corpus. They are not just display toggles.
search is present and no include is provided, Fetch defaults to Markdown plus State JSON.{
"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 + citationsSee 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 uses agent-friendly booleans instead of the full body include object.
| MCP tool | Include flags |
|---|---|
fetch | includeMeta, includeAppendix, includeJson |
fetch_search | includeMarkdown, 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.
The CLI is optimized for the common Fetch path. expandai fetch does not currently expose a public --include flag.
expandai fetch <url> for the common path.--format json when you need the JSON output shape.--search, --max-results, and --min-score for CLI Highlights behavior.When you need to choose individual artifacts, reach for body include rather than the CLI.
Batched Fetch accepts shared include options at the start of a run, but the polling path cannot retroactively serve every artifact.
screenshot, json, or appendix as retroactive include fields.See Batched Fetch for status, pagination, and lifecycle behavior.
includeMeta| CLI | Common-path Fetch output. No public include flag today. |
| Batched Fetch | Shared 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 |
appendix | Secondary page regions | Off unless requested | Related links, sidebars, navigation, references, or secondary context matter | How Fetch Works |
meta | Page metadata | Public include default true | Title, URL, snapshot, page metadata, and request context matter | Output Model |
response | HTTP response metadata | Headers are off unless response.includeHeaders is true | Status, redirects, final URL, response metadata, or headers matter | API Reference |
links | Extracted links | Off unless requested | The application needs link inventories or filtered link lists | API Reference |
html | Raw HTML | Off unless requested | The integration needs source HTML for its own parser or audit path | API Reference |
screenshot | Visual capture | Off unless requested | Visual debugging, inspection, or screenshot artifacts matter | Browser Behavior |