Expand AI logo
DocsAPI ReferenceAPI Reference
Glow Active
Login

API Reference

Getting Started

API ReferenceRate LimitingError Handling

Endpoints

Start Batched FetchCancel Batched FetchFetchFetch JSON ModeHighlightsGet Batched Status
Browse docs

Getting Started

API ReferenceRate LimitingError Handling

Endpoints

Start Batched FetchCancel Batched FetchFetchFetch JSON ModeHighlightsGet Batched Status

API Reference

Endpoints, authentication, and response formats for the Expand API

The Expand API extracts structured content from any web page. This reference covers the endpoints, authentication, and response formats.

Base URL

Send all API requests to:

https://api.expand.ai

Authentication

Every request needs an API key, passed in the x-expand-api-key header.

import Expand 



from
'expandai'
const client = new Expand({
apiKey: '{{API_KEY}}'
})

The SDK can also read from the EXPAND_API_KEY environment variable.

curl -X POST https://api.expand.ai/v1/fetch \
  -H "x-expand-api-key: {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Quick start

Make your first API call to extract content from a web page:

import Expand from 'expandai'

const client = new Expand({
  apiKey: '{{API_KEY}}'
})

const result = await client.fetch({
  url: 'https://example.com',
  include: {
    markdown: true
  }
})

console.log(result.data.markdown)
curl -X POST







Endpoints

Fetch

Fetch web pages as LLM-ready Markdown, JSON Mode responses, search snippets, and Batched Fetch runs.

Rate limits

Rate limits apply per organization. When you exceed yours, the API returns a 429 Too Many Requests status. See rate limiting.

Errors

Errors come back as standard HTTP status codes plus a JSON body whose _tag field identifies the error type. See error handling.

On This Page

Base URLAuthenticationQuick startEndpointsRate limitsErrors
https://api.expand.ai/v1/fetch
\
-H "x-expand-api-key: {{API_KEY}}" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"include": {
"markdown": true
}
}'