Docs
FastAF is a plain REST API. Every data endpoint accepts query parameters withGET or a JSON body with POST. Responses are structured data, selected page content, or an image from /screenshot. There is no SDK required; optional Python and JavaScript clients are available below.
SDKs
Python and JavaScript SDKs are published at version 0.2.1. Install the client for your application:
pip install fastaf-sdk
npm i @fastaf-co/fastafPython uses from fastaf import FastAF; JavaScript uses import { FastAF } from '@fastaf-co/fastaf'.
Packages: fastaf-sdk on PyPI and @fastaf-co/fastaf on npm. Try the Hugging Face demo.
Agent discovery
The agent card describes FastAF’s data skills, authentication and payment options using the A2A 1.0 AgentCard data model. This is discovery metadata only: FastAF does not implement A2A message or task operations, so supportedInterfaces is deliberately empty.
The legacy discovery card uses the A2A 0.3 JSON schema, including url: https://api.fastaf.co andprotocolVersion: 0.3.0 for legacy catalog compatibility. That version describes the card format, not an implemented A2A runtime. ItspreferredTransport is https://fastaf.co/docs/#agent-discovery, a namespaced label for our existing REST API, not an A2A transport binding. Neither JSONRPC nor A2A HTTP+JSON operations are supported. Schema validation does not imply A2A protocol conformance; use REST or MCP as documented below.
Use the complete OpenAPI document for REST or the MCP manifest to connect an MCP client. The card’s extension parameters link to these services athttps://api.fastaf.co. REST accepts a bearer API key on/v1/ or x402 payment proofs on /x402/v1/; MCP discovery is public, MCP tool calls need an API key or OAuth sign-in, and MCP does not accept x402 payments. These are alternatives, not two credentials required together. The x402-only OpenAPI lists the 23 account-free payable data paths, one per endpoint, and the testnet demo.
Crawlers and robots.txt
Discovery files tell agents what FastAF offers; robots.txt tells crawlers what your own site allows. For the bots in your logs, our guide to Meta crawler user-agents and robots.txt lists the user-agent strings Meta publishes and how robots.txt applies to them.
Quickstart
curl "https://api.fastaf.co/v1/serp?query=web+scraping+api&country=us" \
-H "Authorization: Bearer YOUR_KEY"Authentication
Pass your key as a bearer token. Your first key arrives in the welcome email sent at signup; additional or replacement keys created in the dashboard are shown once. Keys are stored hashed, so FastAF cannot show or resend a key later, only replace it. Never send a key in a query string: only the Authorization header is accepted.
Authorization: Bearer faf_live_...Endpoints
| Endpoint | Returns | Credits |
|---|---|---|
| /serp | Structured web search results | 5 |
| /maps | Place search and place details | 5 |
| /amazon | Search, products, offers and bestsellers | 1 or 5 |
| Public person profiles | 60 | |
| /youtube | Video search and transcripts | 5 |
| /scrape | Public pages in selectable formats | 1 to 35 |
| /news | Current news search results | 5 |
| /shopping | Product prices and merchants | 10 |
| /scholar | Scholarly publications and citations | 5 |
| /jobs | Job listings and apply links | 5 |
| /ai | AI-assisted search answers and references | 10 |
| /linkedin_jobs | LinkedIn public job listings | 5 |
| /patents | Google Patents | 5 |
| /flights | Google Flights | 5 |
| /bing | Bing web search results | 5 |
| /images | Google Images search results | 10 |
| Public Reddit feed | 1 | |
| /walmart | Walmart product search results | 5 |
| /zillow | US property search by a complete Zillow search URL, such as the city _rb URL in the example. | 5 |
| /ebay | eBay keyword search using resource=search and a search URL. Item URLs use resource=product. | 5 |
| /x | Public X profile details | 5 |
| /screenshot | Full-page or viewport screenshots | 5 |
| /extract | JSON that validates against your JSON Schema | 40 |
Endpoint reference
All paths below are relative to https://api.fastaf.co/v1. Parameters marked required are enforced by the API; every other listed parameter is optional.
/serp · Google SERP API
Search the web and receive structured result data. Localize requests by country, language, location or domain. Choose desktop or mobile, and control pagination and how many results come back.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required. Search query (q is accepted as an alias) |
| results | Optional. Maximum results returned. Google serves up to 10 per page; use page for more |
| page | Optional. Zero-based page from 0 to 100 |
| advance_search | Optional boolean. Advanced search handling; the request costs 10 credits instead of 5 and needs an API key (not available over x402) |
| mob_search | Optional boolean. Request mobile search results |
| device | Optional alias for device targeting: desktop | mobile |
| html | Optional boolean. Include the HTML response |
| deep_scrape | Optional boolean. Enable deeper result extraction |
| domain | Optional. Search domain |
| country | Optional. Country code |
| lang | Optional public alias of language |
| language | Optional. Result language |
| location | Optional. Human-readable location |
| uule | Optional. Encoded location |
| cr | Optional. Country restriction |
| lr | Optional. Language restriction |
| tbs | Optional. Search filter string |
| safe | Optional. Safe-search setting |
| nfpr | Optional. Auto-correction setting |
| filter | Optional. Similar-result filter |
| ludocid | Optional. Local result identifier |
| lsig | Optional. Local result signature |
| kgmid | Optional. Knowledge Graph identifier |
| si | Optional. Search context identifier |
| ibp | Optional. Search vertical selector |
| uds | Optional. Search request data |
Response: organic_results, title, link, snippet, rank
/maps · Google Maps API
Search for businesses and places or retrieve one place by identifier. Responses include compact location details such as address, rating, review count and place ID when available.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required when place_id is omitted. Place or business query (q is accepted as an alias) |
| place_id | Required when query is omitted. Place identifier |
| location | Optional. Place to centre the search on, for example Rome, Italy. Without it, a place named in the query (pizza in Rome, pizza Roma) is used |
| ll | Optional. Exact centre as @latitude,longitude,zoom; cannot be combined with location |
| domain | Optional. Maps domain |
| lang | Optional public alias of language |
| language | Optional. Result language |
| country | Optional. Country code |
| data | Optional. Maps request data |
| type | Optional. search | place |
| page | Optional. Zero-based page from 0 to 100 |
| device | Optional. desktop | mobile |
Response: search_results, name, address, rating, reviews_count, place_id
/amazon · Amazon API
Use one endpoint for product search, product lookup, buying offers and bestseller lists. Search and product requests cost 1 credit; offers and bestsellers cost 5.
GET or POST · 1 or 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required for search (q is accepted as an alias) |
| resource | Optional. search | product | offers | bestsellers; defaults to search |
| asin | Required for product and offers |
| domain | Optional. Marketplace domain |
| country | Optional for search, product, offers and bestsellers |
| lang | Optional public alias of language for search, product and bestsellers |
| language | Optional for search, product and bestsellers |
| postal_code | Optional for search, product and offers |
| page | Optional. Search 1 to 100; bestsellers 1 to 2 |
| premium | Optional boolean for search |
| category_id | Optional for bestsellers |
| type | Optional for bestsellers. bestsellers | new_releases | movers_and_shakers | most_wished_for | most_gifted |
| full_list | Optional boolean for bestsellers |
Response: results, title, asin, price, rating, reviews_count, offers, bestsellers
/linkedin · LinkedIn API
Retrieve structured public details for a LinkedIn person profile. The endpoint accepts profile lookups only; company pages and job listings are not supported.
GET or POST · 60 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| id | Required. Public profile identifier from the profile URL |
| type | Optional. Must be profile; defaults to profile |
| premium | Optional boolean |
Response: name, headline, location, summary, profile_url, followers_count, connections_count
/youtube · YouTube API
Search YouTube videos or retrieve a transcript by video ID. Transcript requests cost 5 credits and search requests cost 5; channel and comment resources are not supported.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| v | Required for transcript. YouTube video ID |
| resource | Optional. transcript | search; defaults to transcript |
| search_query | Required for search |
| country | Optional. Country code |
| lang | Optional public alias of language |
| language | Optional. Preferred language |
| sp | Optional search filter token; search only |
Response: video_results, transcripts, title, channel, duration, views, published_date
/scrape · Web Scraping API
Fetch a public HTTP or HTTPS page as HTML, links, Markdown, a summary or images. Optional JavaScript rendering, premium mode, sessions, waits and country targeting are available.
GET or POST · 1 to 35 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| url | Required. Public HTTP or HTTPS target URL |
| dynamic | Optional boolean. Enable JavaScript rendering; defaults to false |
| js_rendering | Optional alias of dynamic; cannot conflict with dynamic |
| premium | Optional boolean. Use premium proxies; combined with dynamic it needs an API key (not available over x402) |
| challenge_mode | Optional boolean. Alternative rendering mode with its own browser and proxies; 10 credits, not combinable with premium, country or dynamic |
| custom_headers | Optional boolean |
| wait | Optional. Wait time from 0 to 35,000 milliseconds; booking.com defaults to dynamic with wait=8000 |
| country | Optional. Country code; priced like premium (10 credits, 25 with dynamic, which needs an API key) |
| session_number | Optional. Session identifier |
| image | Optional boolean |
| formats | Optional. html | links | markdown | summary | images; summary adds 10 credits and needs an API key (not available over x402) |
| ai_query | Optional. AI extraction query; adds 10 credits and needs an API key (not available over x402) |
| ai_extract_rules | Optional. AI extraction rules; adds 10 credits and needs an API key (not available over x402) |
| type | Optional. image | pdf | pbf |
| max_tokens | Optional integer, 1 to 1,000,000 (about 4 characters per token). Returns JSON with an excerpt; when the page is longer, content_url gives the full page for 1 hour at no extra charge |
Response: html, links, markdown, summary, images
/news · Google News API
Search Google News and receive structured article details, including title, link, source, publication time and snippet when available.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required. News search query |
| results | Optional. Maximum results returned. Google serves up to 10 per page; use page for more |
| country | Optional. Country code |
| page | Optional. Zero-based page |
| domain | Optional. Search domain |
| language | Optional. Result language |
| lr | Optional. Language restriction |
| uule | Optional. Encoded location |
| tbs | Optional. Search filter string |
| safe | Optional. Safe-search setting |
| nfpr | Optional. Auto-correction setting |
| html | Optional boolean. Include the HTML response |
Response: news_results, title, link, source, date, snippet
/shopping · Google Shopping API
Search Google Shopping and receive structured product results with titles, links, prices, merchants, ratings and review counts when available.
GET or POST · 10 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required. Product search query |
| country | Optional. Country code |
| page | Optional. Zero-based page |
| domain | Optional. Search domain |
| language | Optional. Result language |
| lr | Optional. Language restriction |
| shoprs | Optional. Shopping filter token |
| uule | Optional. Encoded location |
| tbs | Optional. Search filter string |
| safe | Optional. Safe-search setting |
| nfpr | Optional. Auto-correction setting |
| html | Optional boolean. Include the HTML response |
Response: shopping_results, title, link, price, merchant, rating, reviews_count
/scholar · Google Scholar API
Search scholarly publications, follow citation relationships or retrieve a result cluster. Filter by language, year, safety settings and pagination.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required when cites and cluster are omitted. Scholarly search query |
| cites | Required when query and cluster are omitted. Citation identifier |
| cluster | Required when query and cites are omitted; cannot be combined with them |
| html | Optional boolean. Include the HTML response |
| language | Optional. Result language |
| lr | Optional. Language restriction |
| as_ylo | Optional. Earliest publication year |
| as_yhi | Optional. Latest publication year |
| scisbd | Optional. Sort and date control |
| as_sdt | Optional. Search type control |
| safe | Optional. Safe-search setting |
| filter | Optional. Similar-result filter |
| as_vis | Optional. Citation visibility control |
| as_rr | Optional. Review-article control |
| page | Optional. Zero-based page |
| results | Optional. Result count of 1 or more |
Response: scholar_results, title, title_link, publication, snippet, cited_by
/jobs · Google Jobs API
Search Google Jobs and receive structured roles with company, location, listing details and apply links when available.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required. Job search query |
| country | Optional. Country code |
| language | Optional. Language or locale |
| uule | Optional. Encoded location |
| domain | Optional. Search domain |
| next_page_token | Optional. Pagination token |
| chips | Optional. Job filter chips |
| lrad | Optional. Distance filter |
| ltype | Optional. Job type filter |
| uds | Optional. Search request data |
Response: jobs_results, title, company_name, location, extensions, apply_links
/ai · Google AI Mode API
Ask Google AI Mode a question and receive structured answer blocks with references. Localize by country, language, location or encoded location.
GET or POST · 10 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required. Question for AI-assisted search |
| country | Optional. Country code |
| language | Optional. Answer language |
| uule | Optional. Encoded location; cannot be combined with location |
| location | Optional. Human-readable location; cannot be combined with uule |
| safe | Optional. Safe-search setting |
| html | Optional boolean. Include the HTML response |
Response: text_blocks, snippet, links
/linkedin_jobs · LinkedIn Jobs API
JSON array of public LinkedIn job listings with title, company, location and job link when available. Public listings only, no authenticated content.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| field | Required job title or company keyword, e.g. Python developer; no default. |
| geoid | LinkedIn location ID; default 92000000 (worldwide). |
| location | Location text, e.g. London; omit for worldwide jobs. |
| page | One-based result page, integer at least 1; default 1. |
| sort_by | Posting-date filter: day, week or month; omitted means no date filter. |
| job_type | Employment filter: temporary, contract, volunteer, full_time or part_time; omitted means all types. |
| exp_level | Experience filter: internship, entry_level, associate, mid_senior_level or director; omitted means all levels. |
| work_type | Work model: at_work, remote or hybrid; omitted means all models. |
| filter_by_company | LinkedIn company ID; omitted means all companies. |
Response: job_position, company_name, job_location, job_link
/patents · Google Patents API
Search Google Patents for inventions, patent titles and publication links.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required patent search keywords; no default. |
| page | Result page, integer at least 1; omitted uses source default. |
| num | Result count, integer 1-100; omitted uses source default. |
| sort | Sort order: new or old; omitted uses source default. |
| before | Publication cutoff date in YYYY-MM-DD format; omitted means no cutoff. |
| after | Publication start date in YYYY-MM-DD format; omitted means no cutoff. |
| inventor | Inventor name filter; omitted means any inventor. |
| assignee | Assignee name filter; omitted means any assignee. |
| country | Patent country code; omitted means any country. |
| language | Result language code; omitted uses source default. |
| status | Patent status filter; omitted uses source default. |
Response: organic_results
/flights · Google Flights API
Search Google Flights for flight itineraries and current fares.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| departure_id | Required three-letter uppercase IATA departure airport code; no default. |
| arrival_id | Required three-letter uppercase IATA arrival airport code; no default. |
| outbound_date | Required outbound date in YYYY-MM-DD format; no default. |
| return_date | Return date in YYYY-MM-DD format, on or after outbound_date; optional. |
| type | Trip type: 1 round trip, 2 one way; omitted uses source default. |
| adults | Adult passenger count, positive integer; omitted uses source default. |
| currency | Three-letter uppercase currency code; omitted uses source default. |
| hl | Interface language code; omitted uses source default. |
| gl | Two-letter country code; omitted uses source default. |
| travel_class | Cabin class: 1 economy, 2 premium economy, 3 business, 4 first; omitted uses source default. |
Response: best_flights
/bing · Bing Search API
JSON object with bing_data containing ranked title, link and snippet fields.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required web search keywords; no default. |
| mkt | Market such as en-US; omit for source default, mutually exclusive with cc. |
| cc | Two-letter country code such as us; omit for source default, mutually exclusive with mkt. |
| first | Starting result position, integer at least 1; default 1. |
| count | Requested result count, integer 1-50; actual count varies, omitted uses source default. |
| safeSearch | Adult-content filter: Off, Moderate or Strict; omitted uses source default. |
| filters | Opaque Bing filters copied from a Bing search URL; omitted means no explicit filter. |
| lat | GPS latitude for search origin; omitted uses source default. |
| lon | GPS longitude for search origin; omitted uses source default. |
Response: bing_data, title, link, snippet, rank
/images · Google Images API
Google Images JSON with image results, thumbnails, original image URLs, source links and dimensions when available. Image rights remain with the source.
GET or POST · 10 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| query | Required Google Images search keywords; no default. |
| country | Two-letter search country code; default us. |
| language | Result language code; default en. |
| domain | Google search domain; default google.com. |
| page | Zero-based results page, integer at least 0; default 0. |
| safe | Adult-content filter: active or off; default off. |
| tbs | Advanced Google Images filter expression copied from a search URL; omitted means no filter. |
| imgar | Aspect ratio: s (square), t (tall), w (wide), xw (panoramic); omitted means any. |
| imgsz | Image size such as l, m, i, vga or 2mp; omitted means any size. |
| image_color | Color filter such as bw, trans, red, blue or white; omitted means any color. |
| image_type | Image type: face, photo, clipart, lineart or animated; omitted means any type. |
| licenses | License filter: f, fc, fm, fmc, cl or ol; verify rights with the source before reuse. |
| html | Return raw source HTML when true; default false. |
Response: images_results, image, original, link, original_width, original_height
/reddit · Reddit API
Markdown text for formats=markdown; HTML by default. Public feed entries include titles, dates, links and content; author usernames and links to user profiles are removed. RSS coverage can be partial; rate limits return an error without charge.
GET or POST · 1 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| url | Required public reddit.com subreddit or thread URL, e.g. https://www.reddit.com/r/python/; no default. Reads the public RSS feed only. |
| formats | Response format: html (default) or markdown. Feeds may contain fewer posts or comments than the website. |
Response: Feed title, Entry title, Date, Link, Content
/walmart · Walmart API
Fetch a Walmart search URL and receive structured product results with price, rating, review count, availability and seller data when available.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| url | Required. Full HTTP or HTTPS Walmart search URL |
Response: search_results, title, canonicalUrl, current_price, rating, review_count, availability_status, seller_name
/zillow · Zillow API
Real estate and property listing search API for AI agents: Zillow search URLs return JSON zillow_data with prices, addresses, beds, baths and listing links, plus coordinates and Zestimate when available. Supports US housing research without generic page scraping.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| url | Required full HTTP(S) Zillow URL, e.g. https://www.zillow.com/homes/Austin,-TX_rb/. Short city paths such as /austin-tx/ are normalized. Aliases address, location, city, q, query, search become /homes/<encoded value>_rb/ URLs; digits-only zpid becomes /homedetails/<zpid>_zpid/. Canonical url takes precedence. No default; answers without listings are not charged. |
| X-FastAF-Max-Spend | Optional spending cap in USD, decimal with up to 6 places (e.g. 0.01). If this route's fixed price is above it, the call is refused with 409 spend_cap_exceeded before any payment challenge. x402 clients sign every payment, so no session total is kept here. |
Response: zillow_data
/ebay · eBay API
eBay product search and item data API for AI agents. eBay search or item URLs return JSON listings or product details with titles, prices, condition, shipping and links when available. Supports marketplace research and price comparison.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| url | Required full HTTP(S) eBay search URL (/sch/...) or item URL (/itm/...) on an eBay country domain. Search/filter/pagination options go in this URL. No default. |
| resource | eBay operation: search or product. FastAF defaults to product for /itm/ URLs and search otherwise; both have the same price. |
| html | Return raw source HTML instead of parsed JSON when true; true/false, default false. |
| X-FastAF-Max-Spend | Optional spending cap in USD, decimal with up to 6 places (e.g. 0.01). If this route's fixed price is above it, the call is refused with 409 spend_cap_exceeded before any payment challenge. x402 clients sign every payment, so no session total is kept here. |
Response: search_results
/x · X Scraper API
Look up a public X profile by identifier and receive structured profile details such as name, handle, bio and audience counts when available.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| profileId | Required. Public X profile identifier; casing is exact |
Response: name, handle, description, location, followers_count, following_count, statuses_count, verified
/screenshot · Screenshot API
Capture a public HTTP or HTTPS page as PNG, JPEG or WebP. Choose viewport dimensions, full-page capture, readiness condition and image quality.
GET or POST · 5 credits per request
| Parameter | Requirement and accepted values |
|---|---|
| url | Required. Public HTTP or HTTPS page URL |
| fullPage | Optional boolean. Capture the full page |
| width | Optional. Viewport width |
| height | Optional. Viewport height |
| wait_until | Optional. load | domcontentloaded | networkidle |
| format | Optional. png | jpg | webp; defaults to png |
| quality | Optional. Image quality from 0 to 100; defaults to 80 |
Response: image/png, image/jpeg, image/webp
/extract · Structured Data Extraction API
Structured data extraction API: send a public URL and a JSON Schema, get back JSON that validates against it. An answer that does not match the schema is never charged.
POST only, JSON body · 40 credits per request
Send a public page url and a JSON schema; the answer is JSON that validates against it. One price for plain, rendered and premium pages: 40 credits with an API key, or $0.02 per successful call over x402 at /x402/v1/extract. An answer that is not JSON, does not match the schema or exceeds 64 KB returns 422 extraction_failed with validation_errors: nothing is charged and no x402 payment is settled. An invalid schema is refused before anything is charged.
curl -X POST 'https://api.fastaf.co/v1/extract' \
-H "Authorization: Bearer $FASTAF_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url":"https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html","schema":{"type":"object","required":["title","price","in_stock"],"properties":{"title":{"type":"string"},"price":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number"},"currency":{"type":"string"}}},"in_stock":{"type":"boolean"}}}}'| Parameter | Requirement and accepted values |
|---|---|
| url | Required. Public HTTP or HTTPS page URL, same rules as /scrape; some marketplace and social pages are refused at no cost |
| schema | Required. JSON Schema object (draft 2020-12 subset): root type object or array, at most 8 KB, 5 levels and 50 properties, local $ref only |
| render_js | Optional boolean (alias dynamic). Render JavaScript before extracting, at the same price |
| premium | Optional boolean. Premium proxies, at the same price |
Response: application/json, your schema’s fields, 422 extraction_failed, validation_errors
Example output (?sample=1)
Add ?sample=1 to /v1/serp, /v1/scrape, /x402/v1/serp and /x402/v1/scrape to see an example of the output before paying. It is a fixed, illustrative example taken from the OpenAPI documentation, the same for everyone: q, url and every other parameter are ignored, no data source is contacted, and no API key or payment is needed. The JSON is marked {"sample": true, "illustrative": true}, is publicly cacheable for an hour and is rate-limited per IP. Real calls are billed only for 200 responses.
curl "https://api.fastaf.co/x402/v1/serp?sample=1"Errors
Errors use standard HTTP status codes with a JSON body shaped as { error: { code, message } }. On the keyed API a 402 means the credit balance is exhausted and retrying will not help (on the x402 path it is the payment request). A 429 means a rate or concurrency limit was reached and carries a Retry-After header. Temporary request failures return 502 or 503 and are never billed: the credits reserved for the request are returned to your balance, and x402 payments are not settled. The same goes for a scrape that comes back as a verification check, an empty page or a page without its results: it answers 502 target_blocked, and an answer with no data at all ({}) answers 502 no_data, with the option to retry with (challenge_mode=true, premium=true or dynamic=true).
The same holds on the other endpoints: a verification page, an error page or an empty page returned in place of the data answers 502 target_blocked, and an otherwise successful lookup without what it is for (eBay listings or item, Zillow listings, an X or LinkedIn profile, Walmart products, a YouTube transcript, an Amazon product) answers 502 no_data. Neither is charged. A search with zero results but its metadata is a real answer and is charged.
A blocked call says so: the error body adds blocked: true and a reason, and the X-FastAF-Blocked header carries the same reason. Reasons: challenge (a bot-check page), captcha (a reCAPTCHA or hCaptcha widget), empty and too_short (no content), incomplete (results missing), not_data (a web page in place of JSON), serp_blocked (Google's unusual-traffic or captcha page with no organic results) and, on scrape and SERP, http_403, http_429 and http_503 when the data source refuses the call; those keep their status code and Retry-After. A blocked call is never charged: credits are returned, free credits included, and x402 payments are not settled.
A missing target reported by the source returns 404 target_not_found, for example Product not found for an Amazon product or offer. Check the ASIN, profile/video identifier or URL. No credits, free or paid, are consumed, and x402 payments are not settled. MCP reports TARGET_NOT_FOUND withisError: true inside its normal HTTP 200 JSON-RPC response. An empty or unavailable response without an explicit not-found status remains422 target_unavailable or 502 no_data, also uncharged.
When the data source times out or is down
Every data endpoint, keyed or x402, answers a data source that timed out or could not be reached with 503, a Retry-Afterheader of 5 seconds and the standard error envelope:
HTTP/1.1 503 Service Unavailable
Retry-After: 5
{
"error": {
"code": "upstream_timeout",
"message": "The data source did not answer in time. Nothing was charged; retry after Retry-After seconds.",
"stage": "upstream_fetch",
"retry_after": 5
}
}error.code is upstream_timeout or upstream_unavailable.error.stage is upstream_fetch and error.retry_after is 5. Nothing is charged: reserved credits are refunded and an x402 payment is never settled. Other 503 codes keep the { error: { code, message } } shape, such as capacity_unavailable (also with Retry-After).
Long pages: max_tokens
Add max_tokens (an integer) to /scrape to keep a long page from filling an agent's context. Tokens are estimated at about 4 characters per token. The answer becomes JSON: content, truncated, estimated_tokens, max_tokens and content_type. When the page is longer, content holds its first max_tokens × 4 characters, and content_url (GET /v1/scrape/content/{content_id} with the same key, or GET /x402/scrape/content/{content_id} without payment after an x402 call) returns the whole page for 1 hour, never charged again. The price is the same with or without it; without it the answer is unchanged. The MCP tool scrape_url takes the same max_tokens. Binary responses pass through unchanged. If temporary storage fails, the full text is returned instead, so no second paid call is needed.
GET /v1/scrape?url=https://example.com/long&formats=markdown&max_tokens=2000
{"content":"# Example...","truncated":true,"estimated_tokens":18250,
"max_tokens":2000,"content_type":"text/markdown; charset=utf-8",
"content_id":"9f2c...","content_url":"https://api.fastaf.co/v1/scrape/content/9f2c...",
"expires_at":"2026-10-28T15:00:00.000Z"}Sites with their own rules
booking.comon/scraperenders JavaScript withwait=8000unless you set them (5 credits).zillow.comand eBay URLs are refused on/scrapeat no cost. UseGET /v1/zillow?url=(a Zillow search URL such ashttps://www.zillow.com/homes/Austin,-TX_rb/; short forms like/austin-tx/,/austin-tx/rentals/or/78701/are converted; the listings are inzillow_data) andGET /v1/ebay?url=(an eBay search or/itm/URL, on any eBay domain): both return JSON and cost 5 credits./mapscentres the search onlocation, or on a place named in the query (pizza in Rome,pizza Roma);llsets exact coordinates. When a place is asked for and the results are not in it, or the place is unknown, the answer is502 no_dataand nothing is charged. Without a place, results default to the US.
Concurrency is 2 requests in parallel on the free tier, 5 on every paid pack and 25 on the $799 pack.
Service status: api.fastaf.co/status.json (also /v1/status, no key) gives the last hourly self-check: every endpoint probed without a key and without payment, the x402 payTo compared with every address FastAF publishes, and whether the data source is reachable. stale: true means no check has run in the last two hours.
{
"error": {
"code": "concurrency_limit",
"message": "Concurrent request limit reached."
}
}Credits
Every pack adds to one pool of credits on your account, shared by all its keys and spendable across all endpoints. Amazon search and product cost 1 credit; offers and bestsellers cost 5. YouTube transcripts cost 5 and search costs 5. A basic page scrape costs 1, dynamic rendering costs 5, premium mode or country targeting costs 10, and dynamic plus premium or country costs 25. AI extraction (ai_query, ai_extract_rules orformats=summary) adds 10 credits to any of those. Structured extraction (/extract) costs 40 credits per successful call, whatever the page needs. All other costs are listed in the endpoint table above.
X-FastAF-Credits-Used: 5
X-FastAF-Free-Credits-Used: 0
X-FastAF-Cost-Version: v1
X-Request-Id: req_3f9c0d6a2b7e4c1f8a5d9e0b1c2d3e4f
X-FastAF-Receipt: request_id=req_3f9c…; endpoint=serp; credits=5; free_credits=0; usd=0.002500; usd_basis=starter_pack_rate; sha256=…; x402_tx=noneEvery response carries X-Request-Id, errors included: quote it to support. A successful data call also carries a receipt in X-FastAF-Receipt and, when the answer is a JSON object, as request_id and receipt fields at its end: the credits taken (and how many were free), the cost in USD (the paid credits at the Starter pack rate, or the x402 price paid), the sha256 of the data and, over x402, the settlement transaction (x402_tx). For a JSON answer the hash covers JSON.stringify of the body without request_id and receipt; for any other format, the exact bytes received. The receipt only describes the call: it changes nothing about what is charged.
Your remaining balance is not returned per request. Call GET /v1/usage when you need it: it returns the free credits left this month (free_credits_remaining, out of free_credits_monthly, reset atfree_credits_reset_at), the paid balance (balance_credits), the paid credits spent since the account was created (lifetime_usage_credits), your concurrency limit (concurrency_limit) and the requests running right now (active_requests).
Spending cap (X-FastAF-Max-Spend)
An agent can cap what it spends. Send X-FastAF-Max-Spend in US dollars (up to 6 decimals, for example 0.50): a call that would go over it is refused with 409 spend_cap_exceeded before anything is reserved or charged. Alone, the header caps that one call. Add X-FastAF-Session (any id of 1 to 128 letters, digits, . _ : -) and the cap covers the running total of every call your account makes with that id, until 24 hours after its last call. Credits count at the Starter price, $0.0005 each, so the cap is never looser than you meant; failed calls and monthly free credits count for nothing. It works on /v1/*, /tavily/* and on /mcp (set the headers in the MCP client config). On x402 the client signs each payment itself, so there the header only refuses a call whose fixed price is above it, before the 402 challenge; no session total is kept.
curl -H "Authorization: Bearer $FASTAF_KEY" -H "X-FastAF-Max-Spend: 0.50" -H "X-FastAF-Session: run-42" "https://api.fastaf.co/v1/serp?query=coffee"
HTTP/1.1 409 Conflict
{"error":{"code":"spend_cap_exceeded","message":"..."},
"spent_usd":"0.4975","cap_usd":"0.5","requested_usd":"0.0025",
"requested_credits":5,"session":"run-42"}Asynchronous scrape
Use async=true or Prefer: respond-async on scrape. A scrape still running after 25 seconds also returns 202 with ajob_id and Location. PollGET /v1/scrape/jobs/{job_id} with a key from the same account. Status is pending, done (result and content type), orfailed. Only successful completion spends credits.
Use Idempotency-Key to retry submission without duplicate work. Jobs, results and idempotency expire one hour after submission; unknown, expired and unauthorized jobs return 404. Sanitized results are stored temporarily for delivery, up to 1 MB per job.
For x402, submission verifies payment but a 202 never settles it. Save the private X-Scrape-Token response header and send it when polling/x402/v1/scrape/jobs/{job_id}. A ready result returns a new 402 challenge; pay that challenge to receive it. Further reads are free. Never share the token. MCP scrape_url accepts async; poll using the returned job_id and the original url.
max_tokens applies when the scrape answers directly; a polled REST or x402 job returns the full result (MCP polling applies it again). WithX-FastAF-Session, a job still pending when the request returns counts toward the session at its full price.
AI agents
An agent calls FastAF like any other client: a bearer key over REST, or no key at all with pay per call over x402. With a key, the part worth designing is the budget. The credit balance belongs to the account and is shared by all its keys, so it is a limit the model cannot exceed no matter what it decides to do: once the balance is exhausted, every request returns 402 instead of spending more. Keep the balance on the account an agent uses no larger than what you are willing to let it spend.
Read the cost of each call from X-FastAF-Credits-Used to keep a per-run budget, return budget exhaustion to the model as a tool result rather than an exception, and keep the parallel fan-out at or below your account's concurrency limit. There is a worked example in this guide.
To keep each response small in the model’s context (Markdown instead of HTML, named fields instead of pages, capped result counts), see token-efficient web data for AI agents.
Get an API key
Create an account at fastaf.co/signupand confirm your email to get 500 free credits every month (about 100 Google searches). Your first API key is in the welcome email with the confirmation link; create more in the dashboard if you need them. Existing agent accounts and their API keys continue to work.
Top the key up with a pack (starter, growth, scale, pro or business), either over x402 in USDC, credited only after the payment settles, or with a payment link:
# x402: the first call returns 402 with the price, an x402 client signs and retries
curl -i -X POST "https://api.fastaf.co/x402/topup?pack=starter" -H "Authorization: Bearer YOUR_KEY"
# payment link
curl -X POST "https://api.fastaf.co/v1/checkout" -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" -d '{"pack": "starter"}'For Claude Code and Codex there is a skill that teaches the agent when to reach for FastAF and how to get a key:
mkdir -p ~/.claude/skills/fastaf && curl -fsSL https://fastaf.co/skills/fastaf/SKILL.md -o ~/.claude/skills/fastaf/SKILL.mdMCP server
FastAF is also a hosted, stateless MCP server (Streamable HTTP, spec 2026-07-28) at https://api.fastaf.co/mcp. Discovery is public: initialization, tool listing and the other list methods need no key. Tool calls need the same bearer API key (or x-api-key), or an OAuth access token. Static discovery documents are public too. Results are compact by design, every tool response reports credits_used and credits_remaining, and the same credit cap and rate limits apply as on REST. Get a key atfastaf.co/signup. The server does not take x402 payments itself, so an agent without a key pays per call on the x402 REST endpoints.
The official server is co.fastaf/fastaf in the MCP Registry, with the endpoint https://api.fastaf.co/mcp, so anyone can check who runs it.
A tool call with a missing or invalid key receives HTTP 401 with a WWW-Authenticatechallenge pointing to public RFC 9728 resource metadata. The path-specific metadata for /mcp is also available. The metadata names FastAF’s OAuth authorization server, so OAuth-capable clients can sign in instead of using a static key; the consent page asks for an existing FastAF API key, which is never handed to the client. Initialization and listing spend no credits. There is no GET event stream: GET receives 405 withAllow: POST.
scrape_url: Fetch a public web page and return clean Markdown; render_js for pages built in the browser, premium for sites that refuse plain requests.google_search: Search the web and return a compact organic result list.google_maps_places: Search for businesses and places with compact location details.amazon_product: Look up one Amazon product by ASIN or search for products.search_news: Search current news and return compact article details.google_shopping_prices: Search products and return compact prices and merchant details.search_scholar: Search scholarly publications and return compact citation details.search_jobs: Search jobs and return role, company, location and apply links.google_ai_answer: Ask AI-assisted search and return an answer with references.search_linkedin_jobs: Find public LinkedIn job listings by job title or company, with location and work-model filters. Use for LinkedIn vacancies; for jobs across sources use search_jobs. Required: field.search_patents: Search Google Patents for inventions, patent titles and publication links.search_flights: Search Google Flights for flight itineraries and current fares.bing_search: Find web pages with Bing titles, URLs, snippets and ranks. Use for an alternative search index; for Google results use google_search. Required: query.google_images: Find Google Images results with thumbnails, source URLs and dimensions. Use for image discovery; for web pages use google_search. Required: query. Verify image rights before reuse.read_reddit: Read a public Reddit subreddit or thread as markdown from its RSS feed. Use for public discussions; for other websites use scrape_url. Required: url. Feed coverage may be partial.search_ebay: Search eBay listings or retrieve an item by ID.search_zillow: Search public Zillow property listings.search_walmart: Search Walmart products and return price and availability details.x_profile: Look up a public X profile by username.search_youtube: Search YouTube and return video and channel details.youtube_transcript: Retrieve a YouTube video transcript as compact Markdown.get_linkedin_profile: Retrieve compact public details for a LinkedIn person profile.extract: Extract JSON from a public URL using your JSON Schema; answers that do not validate are not charged.
Set FASTAF_API_KEY in the environment of the client process. For secure key loading and troubleshooting, follow the setup guide for Claude Code, Codex and Cursor:Add FastAF to Claude Code, Codex and Cursor.
Step-by-step pages: Claude Code, Cursor, Vercel AI SDK, OpenAI Agents SDK and LangChain.
Codex (~/.codex/config.toml):
[mcp_servers.fastaf]
url = "https://api.fastaf.co/mcp"
bearer_token_env_var = "FASTAF_API_KEY"Claude Code (single quotes keep the environment reference out of shell expansion):
claude mcp add --transport http --scope user fastaf https://api.fastaf.co/mcp \
--header 'Authorization: Bearer ${FASTAF_API_KEY}'Cursor and other clients (mcp.json):
{
"mcpServers": {
"fastaf": {
"url": "https://api.fastaf.co/mcp",
"headers": { "Authorization": "Bearer YOUR_KEY" }
}
}
}Pay per call (x402)
Try FastAF free on testnet. Point your agent at GET https://api.fastaf.co/x402/v1/demo/search?query=... on Base Sepolia. It costs $0.001 in test USDC from the Circle faucet, returns up to 3 real results, and allows 5 verified attempts per IP per UTC day (failed ones count too). When it works, switch to /x402/v1/serp on Base mainnet ($0.003 per successful call). See x402 pay-per-call for the request and payment flow.
Any client that speaks x402 can call FastAF with no account, no API key and no signup, paying each request in USDC from its own wallet. All 23 endpoints are available at https://api.fastaf.co/x402/v1/{endpoint} with GET and the same query parameters as the keyed endpoint under https://api.fastaf.co/v1; /x402/v1/extract takes a POST with a JSON body.
- Payment: USDC on Base (
eip155:8453), x402 v2, schemeexact. - Price: fixed per endpoint, independent of API-key credits. Google search (
/serp): $0.003. Full list below. - Options that cost more than the fixed price need an API key: advanced search, a scrape with JavaScript rendering plus premium proxies or
country, and AI extraction. A signed request with them gets400 options_need_api_keybefore any payment. - Same target rules as the keyed API: public pages only, see the Acceptable Use Policy.
The first request without payment returns 402 with a PAYMENT-REQUIRED header that states the exact price:
curl -i "https://api.fastaf.co/x402/v1/serp?query=coffee"
HTTP/2 402
payment-required: eyJ4NDAyVmVyc2lvbiI6Mi...The JSON with_a_key field offers an alternative: create an account, verify your email to unlock 500 free credits every month (not valid on x402). You can pay per successful call via x402 from $0.003, or buy optional one-time credit packs for your API key, without expiry.
The header is base64 JSON listing the scheme, the network, the USDC amount and the address to pay. An x402 client signs the payment and retries with a PAYMENT-SIGNATURE header. The response comes back 200 with the data and a PAYMENT-RESPONSE header carrying the settlement receipt.
In Node, the official @x402/fetch wrapper does the whole round trip (@x402/axios works the same way, and so does any agent wallet that speaks x402):
npm install @x402/fetch @x402/core @x402/evm viemimport { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.WALLET_KEY) });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const res = await fetchWithPayment("https://api.fastaf.co/x402/v1/serp?query=coffee");
console.log(res.headers.get("PAYMENT-RESPONSE"), await res.json());Price per call
| Endpoint | x402 price |
|---|---|
/x402/v1/serp | $0.003 |
/x402/v1/amazon | $0.003 |
/x402/v1/reddit | $0.003 |
/x402/v1/maps | $0.005 |
/x402/v1/youtube | $0.005 |
/x402/v1/scrape | $0.005 |
/x402/v1/news | $0.005 |
/x402/v1/scholar | $0.005 |
/x402/v1/jobs | $0.005 |
/x402/v1/linkedin_jobs | $0.005 |
/x402/v1/patents | $0.005 |
/x402/v1/flights | $0.005 |
/x402/v1/bing | $0.005 |
/x402/v1/walmart | $0.005 |
/x402/v1/zillow | $0.005 |
/x402/v1/ebay | $0.005 |
/x402/v1/x | $0.005 |
/x402/v1/screenshot | $0.005 |
/x402/v1/shopping | $0.01 |
/x402/v1/ai | $0.01 |
/x402/v1/images | $0.01 |
/x402/v1/extract | $0.02 |
/x402/v1/linkedin | $0.06 |
The payment is settled only after the request succeeds. If the call fails, the signed payment is never settled, so nothing is charged.
The MCP server runs tools with a bearer API key or OAuth sign-in and account credits; x402 is the REST path. Prepaid credit packs remain cheaper at volume and keep working as a hard spending cap.