Expand AI logo
DocsDocs
Glow Active
API Reference
Login

Documentation

Get started

IntroductionWhy ExpandQuickstartAuthenticationConnect your agent (MCP)

Products

OverviewFetching a URLBatched Fetch
API reference
OverviewTwo ways to highlightWorking with snippetsAPI reference

SDKs & tools

TypeScript SDK
MCP tools & resourcesDocs for agents

Reference

API referenceErrors & retriesPricing & UsageLimitsConcurrency tiersFAQ
Browse docs

Get started

IntroductionWhy ExpandQuickstartAuthenticationConnect your agent (MCP)

Products

OverviewFetching a URLBatched Fetch
API reference
OverviewTwo ways to highlightWorking with snippetsAPI reference

SDKs & tools

TypeScript SDK
MCP tools & resourcesDocs for agents

Reference

API referenceErrors & retriesPricing & UsageLimitsConcurrency tiersFAQ

Working with snippets

A snippet is one passage of the page that matches your query. Highlights returns a ranked list of snippets, under highlights.snippets, instead of the whole document. A snippet can come from the Main Markdown, State JSON, or Appendix.

A snippet is one passage that matched your query, with its source, its score, and a link back to where it sits on the page. Here, a query for plan limit matches a row in the Main Markdown and the value behind it in the State JSON:

{
  "highlights": {
    "query": "plan limit",
    "snippets": [















{
"source": "markdown",
"text": "| Plan | Projects | Seats |\n| --- | --- | --- |\n| Pro | 10 projects | 50 seats |",
"score": 0.94,
"location": { "evidenceId": 1204 }
},
{
"source": "statejson",
"text": "planLimits.pro.projects: 10",
"json": { "plan": "pro", "projects": 10, "seats": 50 },
"score": 0.91,
"location": { "evidenceId": 3, "jsonPath": "$.planLimits.pro" }
}
]
}
}
FieldDefinition
textThe passage itself, readable.
sourceWhere it came from: markdown, statejson, or appendix.
scoreHow well it matches the query, from 0 to 1. Snippets are ranked by it.
Note
No kind of snippet, and no snippet order, is guaranteed. Highlights returns only what scores above minScore, and ranking can change as the capture, the layers, and the ranker improve.

Citing a snippet

Every snippet's location.evidenceId becomes a link that opens the exact spot on the page:

https://expand.land/s/<snapshotId>?id=<evidenceId>

With the API, build the link from location.evidenceId. The CLI and MCP add it for you, as citationUrl.

How to inspect a citation is on Playground & replay: Citation links.

Reading beyond a snippet

When a snippet does not provide enough context, you can read the snippet's surrounding content or read the entire Main Markdown. Neither creates a new Fetch nor costs any credits. No API key is needed.

# Read around one snippet, using its evidence ID.
curl -H "Accept: text/markdown" "https://expand.land/s/<snapshotId>/content?id=<evidenceId>"

# Read the full Main Markdown.
curl -H "Accept: text/markdown" "https://expand.land/s/<snapshotId>/content"

To see everything inside a Snapshot, such as the original HTML and the network requests, see Progressive disclosure.

Next steps

  • Two ways to highlight: get snippets as you fetch, or from a Snapshot you already have.
  • Playground & replay: open a citation and see the snippet in place.
  • Progressive disclosure: everything else a Snapshot saves.
PreviousTwo ways to highlight
NextCrawl: Overview

On This Page

Citing a snippetReading beyond a snippetNext steps
json
For a State JSON snippet, the structured value behind the match, when it fits inline.
location.evidenceIdThe exact spot on the page it came from, when available. It turns into a citation link.
location.jsonPathFor a State JSON snippet, where the value sits in the State JSON, when available.