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_searchRanked web search with optional synthesized answer.
POST /ff_fetchFetch and normalize a single page (HTML or Markdown).
POST /ff_crawlBounded crawl with depth, page, and domain controls.
POST /ff_mapDiscover URLs from a root page.
POST /ff_extractStructured extraction from page text.
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)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.