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_search

    Ranked 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_verify

    Verify a claim against fetched web sources and return a stance-scored verdict (supported, contradicted, mixed, or unverified) with verified quote spans.

  • POST /ff_fetch

    Fetch 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_crawl

    Bounded crawl with depth, page, and domain controls. Set rawHtml:true to receive raw HTML per page instead of markdown.

  • POST /ff_map

    Discover URLs from a root page.

  • POST /ff_extract

    Structured 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

HTTPErrorMeaning
400invalid_requestInput validation failed.
401missing_api_key / invalid_api_keyNo, invalid, revoked, or expired API key.
403scope_deniedKey lacks the required scope.
402subscription_required / subscription_inactiveNo active entitlement.
402quota_exceededMonthly usage limit exceeded.
429rate_limit_exceededPer-minute rate limit exceeded.
500internal_errorInternal server error.
503search_backend_unavailableA 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 fetched
  • ff_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) and groundingOptions to 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 to true to receive raw HTML for each crawled page instead of markdown.
  • ff_fetch with js:true now accepts waitForSelector/extraWaitMs for pages that render content after network idle (e.g. client-side data fetching in SPAs).