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

Highlights

Narrow a Fetch to what matches your query and get ranked, cited snippets instead of the whole document.

Even accurate Markdown can run to thousands of tokens. Your agent costs more, responds more slowly, and answers less accurately. Highlights takes a query and returns only the passages that answer it, ranked and cited, from the Main Markdown, State JSON, and, optionally, the Appendix.

1/3

Rendered page

Acme pricing

Every plan starts with a 14-day trial.

PlanPriceSeats
Free$01 seat
Pro$2010 seats
Team$5050 seats

Cancel within 30 days for a full refund.

Hidden page script

<script>window.__PRICING__ = { "plans": { "pro": { "seats": 10 } } }</script>

markdown · score 0.94?id=1204

| Plan | Price | Seats | | --- | --- | --- | | Pro | $20 | 10 seats |

statejson · score 0.91?id=3

plans.pro.seats: 10

Whole page: 3,200 tokens · Highlights: 18 tokens

The page on the left, the snippets Highlights returns on the right. The page, scores, and token counts are made up.

Where Highlights shows up

Fetch Highlights runs while a page is fetched. Snapshot Highlights runs on a Snapshot you already have. For each, this table shows what to call on every surface and where the snippets come back:

Fetch Highlights
Snapshot Highlights
API/v1/fetch or /v1/fetch/json, with highlightsPOST /v1/snapshots/<snapshotId>/highlights
TypeScript SDKfetchJson() or fetch(), with highlightssnapshots.get(), with highlights
CLIexpandai fetch --highlights

Fetch Highlights is a normal Fetch with a Highlights query added. Snapshot Highlights adds the same highlights option to a Snapshot read and takes a snapshotId instead of a URL. Without highlights, a Snapshot read returns its public catalog.

Next steps

  • Two ways to highlight: Fetch Highlights and Snapshot Highlights, with code, and how to tune the results.
  • Working with snippets: what a snippet contains, how to cite it, and how to read beyond it.
  • Wayback Machine: the Snapshots Highlights searches.
PreviousProgressive disclosure
NextTwo ways to highlight

On This Page

Where Highlights shows upNext steps
expandai snapshots get --highlights
MCPfetch tool, with highlightsget_snapshot tool, with highlights
Results are returned indata.highlightshighlights