REST API & OpenAPI 3.1
Every EdgeFetch Hub exposes a stateless JSON REST API alongside its Streamable HTTP MCP server (POST /mcp). Both surfaces share the exact same canonical JSON Schema 2020-12 definitions so tool and REST parameters never drift.
OpenAPI 3.1.0 specification
Section titled “OpenAPI 3.1.0 specification”- Canonical specification:
https://edgefetch.dev/openapi.json - Live Hub specification:
https://<your-hub>/openapi.json(served withAccess-Control-Allow-Origin: *andX-Content-Type-Options: nosniffby both the Cloudflare Workers hub andedgefetch --mode=hub)
curl -sS https://edgefetch.dev/openapi.json | jq '{openapi, version: .info.version, paths: (.paths | length)}'Authentication
Section titled “Authentication”Protected /v1/*, /v2/*, /fetch, /agents, and /mcp endpoints accept either a Bearer token or a self-hosted OAuth 2.1 access token:
- Bearer / API Token (
bearerAuth): PassAuthorization: Bearer <token>(orX-API-Key: <token>) using your HubCALLER_TOKENor scopedMCP_TOKEN. During a rotation, an optionalCALLER_TOKEN_PREVIOUSsecret is accepted besideCALLER_TOKENon/v1/*,/fetchand/agents. A rejected/v1/*call returns401with areason(missing_token,token_rejectedorgrant_revoked). - OAuth 2.1 + PKCE & GitHub Sign-In (
oauth2Pkce): Self-hosted Authorization Code flow with mandatoryS256PKCE, RFC 7591 Dynamic Client Registration, and optional multi-user Sign in with GitHub (GET /admin/auth/github,SIGNUP_MODE=invite_onlydefault):- Protected Resource Metadata (RFC 9728):
GET /.well-known/oauth-protected-resource - Authorization Server Metadata (RFC 8414):
GET /.well-known/oauth-authorization-server - Scopes:
crawl:read(capabilities, extractors, MCP registry search, host telemetry, stored artifacts, search),crawl:fetch(outbound scraping, crawling, mapping, browser interaction, jobs, salaries, company profiles, catalog, and autonomous agent runs), andmcp:call(listing and calling tools on connected MCP servers throughPOST /v1/mcp/queryorquery_mcp).
- Protected Resource Metadata (RFC 9728):
On a multi-user hub, an access policy can also allow or deny individual MCP tools and /v1 routes, globally or per user. Hub owners bypass it.
Endpoint reference
Section titled “Endpoint reference”Discovery & system
Section titled “Discovery & system”| Method & Path | Auth / Scope | Description |
|---|---|---|
GET /health |
Public | Liveness check ({ "ok": true }) |
GET /openapi.json |
Public | OpenAPI 3.1.0 JSON specification (CORS-enabled) |
GET /.well-known/edgefetch-bot.json |
Public | Bot transparency manifest (robots.txt & Content-Signal policy) |
GET /.well-known/http-message-signatures-directory |
Public | RFC 9421 Web Bot Auth Ed25519 JWKS directory |
GET /.well-known/oauth-protected-resource |
Public | RFC 9728 OAuth 2.1 Protected Resource metadata |
GET /.well-known/oauth-authorization-server |
Public | RFC 8414 OAuth 2.1 Authorization Server metadata |
GET /admin/auth/github |
Public (interactive) | Start Sign in with GitHub (PKCE S256) for /admin or /oauth/authorize |
GET /admin/auth/github/callback |
Public (interactive) | Complete the GitHub sign-in callback (SIGNUP_MODE=invite_only gated) |
GET /v1/capabilities |
crawl:read |
Configured R2, D1, FTS5, SERP, OCR, MCP vault, and BYO-LLM bindings |
GET /v1/extractors |
crawl:read |
List the 491 built-in declarative YAML site & API adapters (?category=...) |
GET /v1/mcp/catalog |
crawl:read |
The curated catalog of 26 official vendor remote MCP servers, with endpoints, transports, domains and read-only locks |
GET /v1/mcp/registry |
crawl:read |
Search the vendor catalog, Official MCP Registry, Smithery, PulseMCP and (with GLAMA_API_KEY) Glama (?q=...&remoteOnly=false&limit=20) |
GET /v1/mcp/shared |
crawl:read |
MCP servers other hub users have shared with you (name, slug and cached tools; never the URL or credentials) |
GET /v1/hosts |
crawl:read |
Per-host EWMA TTFB, polite pause windows, and 429 health |
GET /v1/hosts/gaps |
crawl:read |
Rank hosts by headless-browser fallback time and non-OK rate, flagging those without an adapter (?days=7&limit=25&unadapted=false) |
GET /v1/artifacts/{blobSha256} |
crawl:read |
Stream or page stored R2 raw/Markdown artifacts (?offset=&limit=) |
GET /agents |
CALLER_TOKEN |
Connected outbound Go worker nodes (capabilities, sandbox posture, arch, counters) |
Core /v1/* & coordinator endpoints
Section titled “Core /v1/* & coordinator endpoints”| Method & Path | Scope | Description |
|---|---|---|
POST /v1/scrape |
crawl:fetch |
Scrape one https:// URL to clean Markdown, JSON, PDF text/OCR, or metadata |
POST /v1/batch/scrape |
crawl:fetch |
Scrape 1..100 URLs politely (sync: true or async batch ID) |
GET /v1/batch/scrape/{batchId} |
crawl:read |
Poll batch scrape progress and results |
DELETE /v1/batch/scrape/{batchId} |
crawl:fetch |
Cancel a running batch scrape job |
POST /v1/extract |
crawl:fetch |
Extract BM25 query-ranked passages across 1..20 URLs |
POST /v1/interact |
crawl:fetch |
Drive a sandboxed Headless Chromium session (click, fill, scroll, screenshot) |
POST /v1/map |
crawl:fetch |
Rapidly list a domain’s URLs from sitemaps, /llms.txt, and links |
POST /v1/crawl/params-preview |
crawl:read |
Convert natural-language crawl goals into includePaths / excludePaths |
POST /v1/crawl |
crawl:fetch |
Start an async (or sync: true) breadth-first site crawl with optional webhooks |
GET /v1/crawl/{crawlId} |
crawl:read |
Poll crawl status and paged documents |
DELETE /v1/crawl/{crawlId} |
crawl:fetch |
Cancel an active crawl job |
POST /v1/search |
crawl:read |
Web search (Serper, Brave, SearXNG, Tavily; Cloudflare Web Search and Ceramic via providers) merged with D1 FTS5 collections; rrf by default when Serper and Brave are both configured. Live-fetch options need crawl:fetch |
GET /v1/collections/{collectionId}/search |
crawl:read |
Query an indexed D1 FTS5 collection (?q=...&limit=10) |
POST /v1/collections/{collectionId}/search |
crawl:read |
Query an indexed D1 FTS5 collection via JSON body |
POST /v1/ingest-tab |
crawl:fetch |
Clip and index a user browser tab into D1 FTS5 |
POST /v1/jobs |
crawl:fetch |
Search official job boards with normalized pay, or verify saved job URLs |
POST /v1/salaries |
crawl:fetch |
Percentiles of employer-posted pay ranges for a job title, by seniority, location and company |
POST /v1/company |
crawl:fetch |
A company profile merged from its website, Wikidata, SEC EDGAR, GitHub, its job board and (when connected) Google Maps, with a source on every field |
POST /v1/catalog |
crawl:fetch |
Polite sequential Shopify & WooCommerce catalog extraction and variant diffing |
GET /v1/catalog/{catalogId} |
crawl:read |
Poll catalog run metadata and snapshot diff summary |
GET /v1/catalog/{catalogId}/records |
crawl:read |
Page & filter catalog products (vendor, productType, availableOnly, query) |
POST /v1/agent |
crawl:fetch |
Multi-step research & schema-validated JSON extraction with BYO-LLM or Ollama |
GET /v1/agent/{agentId} |
crawl:read |
Poll async autonomous agent run status and output |
DELETE /v1/agent/{agentId} |
crawl:fetch |
Cancel a running autonomous agent task |
GET /v1/agent/{agentId}/trace |
crawl:read |
Fetch ordered execution trace spans for an agent run |
POST /v1/mcp/query |
crawl:read; mcp:call for list_tools / call_tool |
List or call tools on a downstream MCP server connected in the caller’s /admin vault (or shared with them, as server: "<ownerUserId>/<slug>") |
POST /fetch |
CALLER_TOKEN |
Low-level multi-URL coordinator dispatch across worker shards |
POST /mcp |
crawl:read / crawl:fetch / mcp:call |
Stateless Streamable HTTP MCP JSON-RPC endpoint (see MCP tools) |
Drop-in Firecrawl v2 compatibility routes (POST /v2/scrape, /v2/crawl, /v2/map, /v2/search, /v2/extract, /v2/agent) are also documented under the Compatibility tag in openapi.json.
Copy-paste curl examples
Section titled “Copy-paste curl examples”Set your Hub URL and token once in your shell:
export EDGEFETCH_URL="https://hub.example.com"export EDGEFETCH_TOKEN="your-caller-or-oauth-token"Scrape a URL to clean Markdown (/v1/scrape)
Section titled “Scrape a URL to clean Markdown (/v1/scrape)”curl -sS -X POST "$EDGEFETCH_URL/v1/scrape" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://developers.cloudflare.com/workers/", "formats": ["markdown"], "onlyMainContent": true }'Hybrid web & collection search (/v1/search)
Section titled “Hybrid web & collection search (/v1/search)”curl -sS -X POST "$EDGEFETCH_URL/v1/search" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "site:go.dev net/http/httptrace phase timing", "maxResults": 5, "mode": "waterfall" }'Multi-ATS job search & link verification (/v1/jobs)
Section titled “Multi-ATS job search & link verification (/v1/jobs)”curl -sS -X POST "$EDGEFETCH_URL/v1/jobs" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "Systems Engineer", "domains": ["cloudflare.com", "tailscale.com"], "remote": true, "minBase": 160000, "limit": 10 }'Salary ranges from employer postings (/v1/salaries)
Section titled “Salary ranges from employer postings (/v1/salaries)”curl -sS -X POST "$EDGEFETCH_URL/v1/salaries" -H "Authorization: Bearer $EDGEFETCH_TOKEN" -H "Content-Type: application/json" -d '{ "title": "Senior Software Engineer", "location": "Remote", "basis": "base" }'Sourced company profile (/v1/company)
Section titled “Sourced company profile (/v1/company)”curl -sS -X POST "$EDGEFETCH_URL/v1/company" -H "Authorization: Bearer $EDGEFETCH_TOKEN" -H "Content-Type: application/json" -d '{ "name": "Cloudflare", "domain": "cloudflare.com" }'Storefront catalog extraction & diffing (/v1/catalog)
Section titled “Storefront catalog extraction & diffing (/v1/catalog)”curl -sS -X POST "$EDGEFETCH_URL/v1/catalog" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://shop.example.com", "platform": "auto", "fields": "lean", "maxPages": 10 }'BM25 passage extraction across URLs (/v1/extract)
Section titled “BM25 passage extraction across URLs (/v1/extract)”curl -sS -X POST "$EDGEFETCH_URL/v1/extract" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "urls": [ "https://www.rfc-editor.org/rfc/rfc9309", "https://www.rfc-editor.org/rfc/rfc9421" ], "query": "Crawl-delay Retry-After Ed25519 signature", "chunksPerSource": 3 }'Async breadth-first site crawl (/v1/crawl)
Section titled “Async breadth-first site crawl (/v1/crawl)”curl -sS -X POST "$EDGEFETCH_URL/v1/crawl" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://edgefetch.dev", "includePaths": ["/guides/*", "/reference/*"], "limit": 25, "maxDepth": 2, "collectionId": "edgefetch-docs" }'Sandboxed Headless Chromium interaction (/v1/interact)
Section titled “Sandboxed Headless Chromium interaction (/v1/interact)”curl -sS -X POST "$EDGEFETCH_URL/v1/interact" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com", "actions": [ { "type": "wait", "waitMs": 500 }, { "type": "scroll" } ], "formats": ["markdown"] }'Autonomous BYO-LLM research agent (/v1/agent)
Section titled “Autonomous BYO-LLM research agent (/v1/agent)”curl -sS -X POST "$EDGEFETCH_URL/v1/agent" \ -H "Authorization: Bearer $EDGEFETCH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Compare the latest stable Go and Node.js LTS release versions with source URLs.", "effort": "medium", "zeroDataRetention": true, "llm": { "provider": "openai", "model": "gpt-4.1-mini" } }'1-click import into AI tools & SDK generators
Section titled “1-click import into AI tools & SDK generators”- ChatGPT Custom GPT Actions: Open Configure → Actions → Create new action → Import from URL, paste
https://<your-hub>/openapi.json(orhttps://edgefetch.dev/openapi.jsonand updateservers[0].urlto your Hub), and select Authentication → API Key → Bearer (or OAuth withhttps://<your-hub>/oauth/authorizeandhttps://<your-hub>/oauth/token). - OpenWebUI: Go to Workspace → Tools / External Tools → Add Connection, set type to OpenAPI, enter
https://<your-hub>/openapi.json, and provide your Hub Bearer token. - n8n / Dify / Postman / Scalar: Import directly from URL
https://<your-hub>/openapi.json— CORS (Access-Control-Allow-Origin: *) is enabled out of the box so browser-hosted workspaces fetch the schema without proxy errors. openapi-generator(Typed SDK generation):
npx @openapitools/openapi-generator-cli generate \ -i https://edgefetch.dev/openapi.json \ -g typescript-fetch \ -o ./generated/edgefetch-api