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/fastaf

Python 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

EndpointReturnsCredits
/serpStructured web search results5
/mapsPlace search and place details5
/amazonSearch, products, offers and bestsellers1 or 5
/linkedinPublic person profiles60
/youtubeVideo search and transcripts5
/scrapePublic pages in selectable formats1 to 35
/newsCurrent news search results5
/shoppingProduct prices and merchants10
/scholarScholarly publications and citations5
/jobsJob listings and apply links5
/aiAI-assisted search answers and references10
/linkedin_jobsLinkedIn public job listings5
/patentsGoogle Patents5
/flightsGoogle Flights5
/bingBing web search results5
/imagesGoogle Images search results10
/redditPublic Reddit feed1
/walmartWalmart product search results5
/zillowUS property search by a complete Zillow search URL, such as the city _rb URL in the example.5
/ebayeBay keyword search using resource=search and a search URL. Item URLs use resource=product.5
/xPublic X profile details5
/screenshotFull-page or viewport screenshots5
/extractJSON that validates against your JSON Schema40

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

ParameterRequirement and accepted values
queryRequired. Search query (q is accepted as an alias)
resultsOptional. Maximum results returned. Google serves up to 10 per page; use page for more
pageOptional. Zero-based page from 0 to 100
advance_searchOptional boolean. Advanced search handling; the request costs 10 credits instead of 5 and needs an API key (not available over x402)
mob_searchOptional boolean. Request mobile search results
deviceOptional alias for device targeting: desktop | mobile
htmlOptional boolean. Include the HTML response
deep_scrapeOptional boolean. Enable deeper result extraction
domainOptional. Search domain
countryOptional. Country code
langOptional public alias of language
languageOptional. Result language
locationOptional. Human-readable location
uuleOptional. Encoded location
crOptional. Country restriction
lrOptional. Language restriction
tbsOptional. Search filter string
safeOptional. Safe-search setting
nfprOptional. Auto-correction setting
filterOptional. Similar-result filter
ludocidOptional. Local result identifier
lsigOptional. Local result signature
kgmidOptional. Knowledge Graph identifier
siOptional. Search context identifier
ibpOptional. Search vertical selector
udsOptional. 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

ParameterRequirement and accepted values
queryRequired when place_id is omitted. Place or business query (q is accepted as an alias)
place_idRequired when query is omitted. Place identifier
locationOptional. 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
llOptional. Exact centre as @latitude,longitude,zoom; cannot be combined with location
domainOptional. Maps domain
langOptional public alias of language
languageOptional. Result language
countryOptional. Country code
dataOptional. Maps request data
typeOptional. search | place
pageOptional. Zero-based page from 0 to 100
deviceOptional. 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

ParameterRequirement and accepted values
queryRequired for search (q is accepted as an alias)
resourceOptional. search | product | offers | bestsellers; defaults to search
asinRequired for product and offers
domainOptional. Marketplace domain
countryOptional for search, product, offers and bestsellers
langOptional public alias of language for search, product and bestsellers
languageOptional for search, product and bestsellers
postal_codeOptional for search, product and offers
pageOptional. Search 1 to 100; bestsellers 1 to 2
premiumOptional boolean for search
category_idOptional for bestsellers
typeOptional for bestsellers. bestsellers | new_releases | movers_and_shakers | most_wished_for | most_gifted
full_listOptional 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

ParameterRequirement and accepted values
idRequired. Public profile identifier from the profile URL
typeOptional. Must be profile; defaults to profile
premiumOptional 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

ParameterRequirement and accepted values
vRequired for transcript. YouTube video ID
resourceOptional. transcript | search; defaults to transcript
search_queryRequired for search
countryOptional. Country code
langOptional public alias of language
languageOptional. Preferred language
spOptional 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

ParameterRequirement and accepted values
urlRequired. Public HTTP or HTTPS target URL
dynamicOptional boolean. Enable JavaScript rendering; defaults to false
js_renderingOptional alias of dynamic; cannot conflict with dynamic
premiumOptional boolean. Use premium proxies; combined with dynamic it needs an API key (not available over x402)
challenge_modeOptional boolean. Alternative rendering mode with its own browser and proxies; 10 credits, not combinable with premium, country or dynamic
custom_headersOptional boolean
waitOptional. Wait time from 0 to 35,000 milliseconds; booking.com defaults to dynamic with wait=8000
countryOptional. Country code; priced like premium (10 credits, 25 with dynamic, which needs an API key)
session_numberOptional. Session identifier
imageOptional boolean
formatsOptional. html | links | markdown | summary | images; summary adds 10 credits and needs an API key (not available over x402)
ai_queryOptional. AI extraction query; adds 10 credits and needs an API key (not available over x402)
ai_extract_rulesOptional. AI extraction rules; adds 10 credits and needs an API key (not available over x402)
typeOptional. image | pdf | pbf
max_tokensOptional 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

ParameterRequirement and accepted values
queryRequired. News search query
resultsOptional. Maximum results returned. Google serves up to 10 per page; use page for more
countryOptional. Country code
pageOptional. Zero-based page
domainOptional. Search domain
languageOptional. Result language
lrOptional. Language restriction
uuleOptional. Encoded location
tbsOptional. Search filter string
safeOptional. Safe-search setting
nfprOptional. Auto-correction setting
htmlOptional 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

ParameterRequirement and accepted values
queryRequired. Product search query
countryOptional. Country code
pageOptional. Zero-based page
domainOptional. Search domain
languageOptional. Result language
lrOptional. Language restriction
shoprsOptional. Shopping filter token
uuleOptional. Encoded location
tbsOptional. Search filter string
safeOptional. Safe-search setting
nfprOptional. Auto-correction setting
htmlOptional 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

ParameterRequirement and accepted values
queryRequired when cites and cluster are omitted. Scholarly search query
citesRequired when query and cluster are omitted. Citation identifier
clusterRequired when query and cites are omitted; cannot be combined with them
htmlOptional boolean. Include the HTML response
languageOptional. Result language
lrOptional. Language restriction
as_yloOptional. Earliest publication year
as_yhiOptional. Latest publication year
scisbdOptional. Sort and date control
as_sdtOptional. Search type control
safeOptional. Safe-search setting
filterOptional. Similar-result filter
as_visOptional. Citation visibility control
as_rrOptional. Review-article control
pageOptional. Zero-based page
resultsOptional. 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

ParameterRequirement and accepted values
queryRequired. Job search query
countryOptional. Country code
languageOptional. Language or locale
uuleOptional. Encoded location
domainOptional. Search domain
next_page_tokenOptional. Pagination token
chipsOptional. Job filter chips
lradOptional. Distance filter
ltypeOptional. Job type filter
udsOptional. 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

ParameterRequirement and accepted values
queryRequired. Question for AI-assisted search
countryOptional. Country code
languageOptional. Answer language
uuleOptional. Encoded location; cannot be combined with location
locationOptional. Human-readable location; cannot be combined with uule
safeOptional. Safe-search setting
htmlOptional 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

ParameterRequirement and accepted values
fieldRequired job title or company keyword, e.g. Python developer; no default.
geoidLinkedIn location ID; default 92000000 (worldwide).
locationLocation text, e.g. London; omit for worldwide jobs.
pageOne-based result page, integer at least 1; default 1.
sort_byPosting-date filter: day, week or month; omitted means no date filter.
job_typeEmployment filter: temporary, contract, volunteer, full_time or part_time; omitted means all types.
exp_levelExperience filter: internship, entry_level, associate, mid_senior_level or director; omitted means all levels.
work_typeWork model: at_work, remote or hybrid; omitted means all models.
filter_by_companyLinkedIn 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

ParameterRequirement and accepted values
queryRequired patent search keywords; no default.
pageResult page, integer at least 1; omitted uses source default.
numResult count, integer 1-100; omitted uses source default.
sortSort order: new or old; omitted uses source default.
beforePublication cutoff date in YYYY-MM-DD format; omitted means no cutoff.
afterPublication start date in YYYY-MM-DD format; omitted means no cutoff.
inventorInventor name filter; omitted means any inventor.
assigneeAssignee name filter; omitted means any assignee.
countryPatent country code; omitted means any country.
languageResult language code; omitted uses source default.
statusPatent 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

ParameterRequirement and accepted values
departure_idRequired three-letter uppercase IATA departure airport code; no default.
arrival_idRequired three-letter uppercase IATA arrival airport code; no default.
outbound_dateRequired outbound date in YYYY-MM-DD format; no default.
return_dateReturn date in YYYY-MM-DD format, on or after outbound_date; optional.
typeTrip type: 1 round trip, 2 one way; omitted uses source default.
adultsAdult passenger count, positive integer; omitted uses source default.
currencyThree-letter uppercase currency code; omitted uses source default.
hlInterface language code; omitted uses source default.
glTwo-letter country code; omitted uses source default.
travel_classCabin 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

ParameterRequirement and accepted values
queryRequired web search keywords; no default.
mktMarket such as en-US; omit for source default, mutually exclusive with cc.
ccTwo-letter country code such as us; omit for source default, mutually exclusive with mkt.
firstStarting result position, integer at least 1; default 1.
countRequested result count, integer 1-50; actual count varies, omitted uses source default.
safeSearchAdult-content filter: Off, Moderate or Strict; omitted uses source default.
filtersOpaque Bing filters copied from a Bing search URL; omitted means no explicit filter.
latGPS latitude for search origin; omitted uses source default.
lonGPS 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

ParameterRequirement and accepted values
queryRequired Google Images search keywords; no default.
countryTwo-letter search country code; default us.
languageResult language code; default en.
domainGoogle search domain; default google.com.
pageZero-based results page, integer at least 0; default 0.
safeAdult-content filter: active or off; default off.
tbsAdvanced Google Images filter expression copied from a search URL; omitted means no filter.
imgarAspect ratio: s (square), t (tall), w (wide), xw (panoramic); omitted means any.
imgszImage size such as l, m, i, vga or 2mp; omitted means any size.
image_colorColor filter such as bw, trans, red, blue or white; omitted means any color.
image_typeImage type: face, photo, clipart, lineart or animated; omitted means any type.
licensesLicense filter: f, fc, fm, fmc, cl or ol; verify rights with the source before reuse.
htmlReturn 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

ParameterRequirement and accepted values
urlRequired public reddit.com subreddit or thread URL, e.g. https://www.reddit.com/r/python/; no default. Reads the public RSS feed only.
formatsResponse 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

ParameterRequirement and accepted values
urlRequired. 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

ParameterRequirement and accepted values
urlRequired 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-SpendOptional 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

ParameterRequirement and accepted values
urlRequired 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.
resourceeBay operation: search or product. FastAF defaults to product for /itm/ URLs and search otherwise; both have the same price.
htmlReturn raw source HTML instead of parsed JSON when true; true/false, default false.
X-FastAF-Max-SpendOptional 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

ParameterRequirement and accepted values
profileIdRequired. 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

ParameterRequirement and accepted values
urlRequired. Public HTTP or HTTPS page URL
fullPageOptional boolean. Capture the full page
widthOptional. Viewport width
heightOptional. Viewport height
wait_untilOptional. load | domcontentloaded | networkidle
formatOptional. png | jpg | webp; defaults to png
qualityOptional. 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"}}}}'
ParameterRequirement and accepted values
urlRequired. Public HTTP or HTTPS page URL, same rules as /scrape; some marketplace and social pages are refused at no cost
schemaRequired. 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_jsOptional boolean (alias dynamic). Render JavaScript before extracting, at the same price
premiumOptional 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.com on /scrape renders JavaScript with wait=8000 unless you set them (5 credits).
  • zillow.com and eBay URLs are refused on /scrape at no cost. Use GET /v1/zillow?url= (a Zillow search URL such as https://www.zillow.com/homes/Austin,-TX_rb/; short forms like /austin-tx/, /austin-tx/rentals/ or /78701/ are converted; the listings are in zillow_data) and GET /v1/ebay?url= (an eBay search or /itm/ URL, on any eBay domain): both return JSON and cost 5 credits.
  • /maps centres the search on location, or on a place named in the query (pizza in Rome, pizza Roma); ll sets exact coordinates. When a place is asked for and the results are not in it, or the place is unknown, the answer is 502 no_data and 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=none

Every 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.md

MCP 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, scheme exact.
  • 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 gets 400 options_need_api_key before 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 viem
import { 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

Endpointx402 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.