# FetchFox · API reference

## Authentication and responses

Use the API host below. Send JSON bodies with Content-Type: application/json and authenticate with Authorization: Bearer YOUR_FETCHFOX_API_KEY. Long-running endpoints accept detach: true. Inspect HTTP status for errors and results or results.items for job output.

```
https://api.fetchfox.ai
```

## Errors and retries

400 indicates invalid input. 402 means insufficient credits. 403 indicates an access problem. 429 means the rate limit was reached. For a timeout on a long scrape, check your jobs before starting another paid run. Billing and key rotation have immediate effects. Operator metrics and benchmark tools appear in MCP for authorized operators. Clerk session and webhook callbacks are handled by the identity integration.

## visit

POST /api/visit

Read rendered page content. Choose url or urls.

- url (string): Public HTTP or HTTPS URL.
- urls (string[]): 
- include (meta | raw | html | slimHtml | markdown | text[]): 
- delivery (inline | artifact): 
- proxy (none | auto | datacenter | residential): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.

## crawl

POST /api/crawl

Discover links matching a pattern or a query from seed pages.

- startUrls (string[]): 
- pattern (string): Target URL pattern, for example https://example.org/articles/*.
- query (string): Describe the URLs to discover.
- maxVisits (integer): Visit budget.
- maxDepth (integer): Maximum depth from a seed.
- crawlStrategy (bfs | dfs | random): 
- priority (object): 
- proxy (none | auto | datacenter | residential): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.

## extract

POST /api/extract

Extract structured records from one URL or a batch of URLs. Lambda extraction requires an object template and explicit perPage.

- url (string): Public HTTP or HTTPS URL.
- urls (string[]): 
- template (string or object, required): 
- perPage (one | many): 
- useBoost (boolean): Allow reuse of a learned extraction.
- contentTransform (raw | html | slim_html | text | markdown): 
- proxy (none | auto | datacenter | residential): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.
- extractExecution (host | lambda): 

## scrape

POST /api/scrape

Discover matching URLs and extract records from them in one job.

- startUrls (string[]): 
- pattern (string): Target URL pattern, for example https://example.org/articles/*.
- query (string): Describe the URLs to discover.
- maxVisits (integer): Visit budget.
- maxDepth (integer): Maximum depth from a seed.
- crawlStrategy (bfs | dfs | random): 
- priority (object): 
- proxy (none | auto | datacenter | residential): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.
- template (string or object, required): 
- perPage (one | many): 
- useBoost (boolean): Allow reuse of a learned extraction.
- contentTransform (raw | html | slim_html | text | markdown): 
- maxExtracts (integer): Extraction budget.

## agent

POST /api/agent

Run a natural-language web data task.

- prompt (string, required): Describe the information to find.
- urls (string[]): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.

## create_agent

POST /api/agent/create

Create a reusable agent from a task description.

- prompt (string, required): Describe the information to find.
- urls (string[]): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.

## list_agents

GET /api/agents

List the agents owned by your account.



## get_agent

GET /api/agent/:id

Read a saved agent and its plan.

- id (string, required): Resource identifier.

## run_agent

POST /api/agent/:id/run

Run your saved agent with its named input parameters.

- id (string, required): Resource identifier.
- params (object): 
- detach (boolean): Return a job ID immediately. Poll get_job for completion.

## plan

POST /api/plan

Generate a plan for a website.

- url (string, required): Public HTTP or HTTPS URL.
- detach (boolean): Return a job ID immediately. Poll get_job for completion.

## list_jobs

GET /api/jobs

List your top-level jobs, newest first.

- offset (integer): Zero-based offset.
- limit (integer): Maximum records returned.
- types (string): Comma-separated job methods, for example crawl,extract.

## get_job

GET /api/jobs/:id

Read job state, results, metrics and progress.

- id (string, required): Resource identifier.

## stop_job

POST /api/jobs/:id/stop

Request cancellation of your job.

- id (string, required): Resource identifier.

## get_job_items

GET /api/jobs/:id/items

Read a page of extracted items for your job.

- id (string, required): Resource identifier.
- offset (integer): Zero-based offset.
- limit (integer): Maximum records returned.

## export_job_csv

GET /api/jobs/:id/items/csv

Export your job items as CSV.

- id (string, required): Resource identifier.

## export_job_jsonl

GET /api/jobs/:id/items/jsonl

Export your job items as newline-delimited JSON.

- id (string, required): Resource identifier.

## list_urls

GET /api/urls

List discovered URLs from your job, optionally filtered by pattern.

- job_id (string, required): Resource identifier.
- pattern (string): URL pattern.
- offset (integer): Zero-based offset.
- limit (integer): Maximum records returned.

## get_artifact

GET /api/artifacts/:id

Get the expiring private download URL for a raw page artifact.

- id (string, required): Resource identifier.

## pdf_text

POST /api/pdf/text

Read text and metadata from a public PDF.

- url (string, required): Public HTTP or HTTPS URL.

## get_pdf_text

GET /api/pdf/text

Read a public PDF as plain text.

- url (string, required): Public HTTP or HTTPS URL.

## summarize

POST /api/summarize

Summarize an object using an account-scoped cache key.

- key (string, required): Your cache identifier.
- object (object, required): 

## record_event

POST /api/events/record

Record a named analytics event. Use props.test for test traffic.

- name (string, required): Event name.
- tid (string): Visitor tracking ID.
- props (object): 

## get_version

GET /api/version

Read the worker revision, or the API revision with local=true.

- local (boolean): Read the HTTP API revision.

## get_token

GET /api/token

Read public FetchFox organization and token quote information.



## get_contracts

GET /api/contracts/:chainId

Read the contract addresses and ABIs for a supported chain.

- chainId (8453 | 31337, required): 

## get_user

GET /api/user

Read your account profile and billing summary.



## rotate_api_key

POST /api/user/rotate-api-key

Replace your current API key. Save the returned key and reconnect your clients.



## get_credit_balance

GET /api/credits/balance

Read purchased, consumed and remaining credits.



## list_transactions

GET /api/credits/transactions

List your credit transactions.



## get_invoice

GET /api/credits/transactions/:id/invoice

Read the HTML invoice for one of your transactions.

- id (string, required): Resource identifier.

## purchase_credits

POST /api/credits/purchase

Charge your saved payment method for credits.

- amount (number, required): Amount in US dollars.

## consume_credits

POST /api/credits/consume

Debit a positive number of credits from your balance.

- amount (integer, required): Credits to consume (1,000 credits = $1).

## set_auto_reload

POST /api/credits/auto-reload

Configure automatic charges when the balance falls below the floor.

- autoReloadEnabled (boolean, required): Enable automatic purchases.
- autoReloadFloor (integer, required): Balance threshold in USD.
- autoReloadTarget (integer, required): Target balance in USD.

## create_card_setup

POST /api/user/stripe/payment-intent

Create a Stripe setup intent for client-side card collection.



## save_card

POST /api/user/stripe/card

Save a Stripe payment method to your account.

- paymentMethodId (string, required): Stripe payment method ID from a completed client-side card flow.

## remove_card

DELETE /api/user/stripe/card

Remove the saved payment method from your account.



## setup_and_charge

POST /api/billing/setup-and-charge

Set up billing and charge the supplied payment method for the selected plan.

- plan (payg | monthly_10, required): 
- amount (number, required): Amount in US dollars.
- paymentMethodId (string, required): Stripe payment method ID from a completed client-side card flow.
