Expand AI logo
DocsAPI ReferenceAPI Reference
Login

API Reference

Getting Started

API ReferenceRate LimitingError Handling

Endpoints

BatchedFetchFetch JsonFetch SearchGet Batched

API Reference

Complete API documentation for Expand.ai

The Expand API enables you to extract structured content from any web page. This reference documents available endpoints, authentication methods, and response formats.

Base URL

All API requests should be made to:

https://api.expand.ai

Authentication

All API requests require authentication via an API key. Include your API key in the x-expand-api-key header with every request.

import Expand from 'expandai'

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

The SDK can also read from the EXPAND_API_KEY environment variable.

from expandai import Expand

client = Expand(api_key="{{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)











Endpoints

Fetch

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

Rate Limits

API requests are rate-limited per organization. When you exceed your limit, the API returns a 429 Too Many Requests status. Learn more about rate limits.

Errors

The API uses standard HTTP status codes and returns structured error responses with a _tag field identifying the error type. Learn more about error handling.

On This Page

Base URLAuthenticationQuick StartEndpointsRate LimitsErrors
from
expandai
import
Expand
client = Expand(api_key="{{API_KEY}}")
result = client.fetch(
url="https://example.com",
include={
"markdown": True
}
)
print(result.data.markdown)
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",
    "include": {
      "markdown": true
    }
  }'