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);

Endpoint reference

  • POST /ff_search

    Ranked web search with optional synthesized answer.

  • POST /ff_fetch

    Fetch and normalize a single page (HTML or Markdown).

  • POST /ff_crawl

    Bounded crawl with depth, page, and domain controls.

  • POST /ff_map

    Discover URLs from a root page.

  • POST /ff_extract

    Structured extraction from page text.

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)
  • ff_crawlmax(1, pages successfully fetched)
  • ff_mapmax(1, ceil(urls discovered / 10))
  • ff_extract2 units

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.