FetchFence API documentation
Base URL: https://api.fetchfence.ai
Authentication
Send your API key as a Bearer token (recommended):
Authorization: Bearer <FETCHFENCE_API_KEY>An x-api-key header is also supported.
Quickstart
curl -X POST https://api.fetchfence.ai/ff_search \
-H "Authorization: Bearer $FETCHFENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"AI agent search APIs","topK":5}'const response = await fetch("https://api.fetchfence.ai/ff_search", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.FETCHFENCE_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ query: "AI agent search APIs", topK: 5 })
});
if (!response.ok) {
throw new Error(`FetchFence error: ${response.status}`);
}
const data = await response.json();
console.log(data.results);Model Context Protocol (MCP)
FetchFence also exposes these tools as an MCP server at https://api.fetchfence.ai/mcp. The MCP tool list is generated from the same OpenAPI spec, so new API capabilities appear in MCP clients automatically.
Read the MCP server documentation for connection instructions, OAuth details, and examples.
Endpoint reference
POST /ff_searchRanked web search with optional synthesized answer. Set grounding to 'fast' or 'strict' to fetch, verify, and cite source pages for every claim in the answer.
POST /ff_verifyVerify a claim against fetched web sources and return a stance-scored verdict (supported, contradicted, mixed, or unverified) with verified quote spans.
POST /ff_fetchFetch and normalize a single page (HTML or Markdown). Set js:true to render JavaScript; with it, waitForSelector/extraWaitMs wait for content that renders after network idle (e.g. SPAs).
POST /ff_crawlBounded crawl with depth, page, and domain controls. Set rawHtml:true to receive raw HTML per page instead of markdown.
POST /ff_mapDiscover URLs from a root page.
POST /ff_extractStructured extraction from page text.
Courier
Courier can retrieve documents that are not directly downloadable, including content that only appears on a page, and can securely route a captured document to your verified destination.
Error codes
| HTTP | Error | Meaning |
|---|---|---|
| 400 | invalid_request | Input validation failed. |
| 401 | missing_api_key / invalid_api_key | No, invalid, revoked, or expired API key. |
| 403 | scope_denied | Key lacks the required scope. |
| 402 | subscription_required / subscription_inactive | No active entitlement. |
| 402 | quota_exceeded | Monthly usage limit exceeded. |
| 429 | rate_limit_exceeded | Per-minute rate limit exceeded. |
| 500 | internal_error | Internal server error. |
| 503 | search_backend_unavailable | A dependency is temporarily unavailable. |
Rate limits and usage units
Each plan includes a per-minute rate limit and a monthly usage-unit allowance. Endpoints consume units as follows:
ff_fetch1 unit (3 with JS rendering; PDFs add 1 unit per MB beyond the first)ff_search1 unit (2 when an answer is synthesized; 2 + sources fetched + 1 if repair ran in grounding mode)ff_verify2 units + 1 per source fetchedff_crawlmapping + extraction: ceil(pages / 10) + ceil(pages / 5) (min 1)ff_mapmax(1, ceil(urls discovered / 10))ff_extract1 unit per 5 URLs (single-URL call = 1)
API key management
Create, rotate, and revoke keys from your dashboard. A key's value is shown once at creation — copy it immediately. Rotating a key immediately disables the previous value.
Best practices
- Store API keys in environment variables or a secret manager.
- Use one key per application so you can rotate independently.
- Handle 429 responses with backoff and 402 responses by checking your plan.
Contact
Need higher limits or have a question? Email support@fetchfence.ai.
Changelog
- Initial public API: search, fetch, crawl, map, extract.
- API keys, usage dashboard, and self-service billing.
- ff_search now supports
grounding(fast/strict) andgroundingOptionsto fetch, verify, and cite source pages for each claim. - New endpoint: ff_verify for stance-scored claim verification against web sources.
- ff_crawl now accepts
rawHtml: set it totrueto receive raw HTML for each crawled page instead of markdown. - ff_fetch with
js:truenow acceptswaitForSelector/extraWaitMsfor pages that render content after network idle (e.g. client-side data fetching in SPAs).