Integrations / Tavily-compatible

Tavily-compatible search and extract API for existing Tavily SDK code

If your code already calls Tavily, through the Python or JavaScript SDK or over HTTP, you can send the same requests to FastAF. Change two things, the base URL and the API key, and keep the rest. Search results come from Google through the FastAF SERP API, and page content from the web scraping API. You pay with credits (see pricing) or per call with x402, and the same key works on every endpoint in the FastAF API catalog.

Which base URL do you use?

How you payBase URLKey
FastAF API key (credits)https://api.fastaf.co/tavilyYour FastAF API key in place of the Tavily key
x402, per call in USDChttps://api.fastaf.co/x402/tavilyNo key; an x402 v2 client signs the payment

The client appends /search and /extract to the base URL. The key goes in Authorization: Bearer, which is what the SDKs send; older clients that put api_key in the JSON body work too.

Python

With the official tavily-python package (checked with version 0.8.5):

from tavily import TavilyClient

client = TavilyClient(
    api_key="YOUR_FASTAF_API_KEY",
    api_base_url="https://api.fastaf.co/tavily",
)
response = client.search("best espresso machine for home", max_results=5)
for result in response["results"]:
    print(result["title"], result["url"])

pages = client.extract(urls=["https://example.com/"])
print(pages["results"][0]["raw_content"])

AsyncTavilyClient takes the same api_base_url argument.

JavaScript

With the official @tavily/core package (checked with version 0.7.14):

import { tavily } from "@tavily/core";

const client = tavily({
  apiKey: process.env.FASTAF_API_KEY,
  apiBaseURL: "https://api.fastaf.co/tavily",
});
const response = await client.search("best espresso machine for home", { maxResults: 5 });
console.log(response.results.map((r) => r.url));

const pages = await client.extract(["https://example.com/"]);
console.log(pages.results[0].rawContent);

curl

curl -X POST https://api.fastaf.co/tavily/search \
  -H "Authorization: Bearer $FASTAF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "best espresso machine for home", "max_results": 5}'

curl -X POST https://api.fastaf.co/tavily/extract \
  -H "Authorization: Bearer $FASTAF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com/"]}'

A search answers in the same shape as Tavily:

{
  "query": "best espresso machine for home",
  "answer": null,
  "images": [],
  "results": [
    {
      "title": "Best espresso machines for home brewing",
      "url": "https://example.com/guides/espresso-machines",
      "content": "Compare compact espresso machines by pressure, grinder and milk-steaming features.",
      "score": 1,
      "raw_content": null
    }
  ],
  "response_time": 1.42,
  "request_id": "0834e596-379c-43b6-97fc-850432abd73d"
}

What does it cost?

The same as calling the FastAF endpoints directly. Failed calls are never charged: with a key the credits come back, and with x402 the payment does not settle.

CallWith an API keyWith x402
search5 credits ($2.50 per 1,000 searches on Starter)$0.003 per search
search with include_raw_content5 credits + 1 credit per result page fetchedNot available: send the result URLs to /extract
extract, basic1 credit per URL extracted$0.005 per URL
extract, advanced5 credits per URL extracted$0.005 per URL, the same as basic

With a key, a page that cannot be fetched is listed in failed_results (or has raw_content: null in a search) and costs nothing. With x402, one payment covers the whole extract call and settles only if every URL succeeds. On x402 the scrape price already covers JavaScript rendering, so an advanced extract costs the same as a basic one, as on /x402/v1/scrape. Credit packs are on the pricing page and x402 prices on the x402 price list.

Which search fields are supported?

FieldStatusNotes
querySupportedRequired, up to 400 characters.
max_resultsSupported0 to 20, default 10. One Google results page holds about 10 results, so asking for more returns at most that page.
include_raw_contentSupportedtrue or "markdown" returns each result page as Markdown; "text" returns plain text. Adds one page fetch per result (see pricing).
include_domains, exclude_domainsSupportedSent to Google as site: filters, up to 10 domains each.
time_range, start_date, end_dateSupportedGoogle date filters (past day, week, month, year, or a custom range).
country, languageSupportedCountry by English name (for example "italy") or two-letter code; language as a two-letter code. Unknown names are ignored.
include_usageSupportedusage.credits reports FastAF credits used (API key only).
include_faviconPartialReturns favicon only when Google provides one, otherwise null.
include_answerNot supportedAccepted; answer is always null. FastAF returns search results, not generated answers.
include_images, include_image_descriptionsNot supportedAccepted; images is always an empty list.
search_depth, chunks_per_sourceIgnoredEvery search runs the same way and costs the same. content is the Google snippet, not ranked chunks.
topicIgnoredEvery search is a Google web search, also for news and finance.
days, include_published_date, filter_by_published_date, include_domains_mode, filter_by_language, auto_parameters, exact_match, safe_search, max_age_hours, fetch_timeout, cache_fallbackIgnoredAccepted, like any unknown field, so existing calls keep working, with no effect on the results.
score (response)Different meaningDerived from the Google rank (1 for the first result, then 0.05 lower per position, minimum 0.05), not a semantic relevance score.
auto_parameters, usage (response)Partialauto_parameters is never returned; usage only with include_usage and an API key.

The response has query, answer, images, results (title, url, content, score, raw_content), response_time and request_id.

Which extract fields are supported?

FieldStatusNotes
urlsSupportedOne URL or a list of up to 20.
extract_depthSupported"basic" fetches the page; "advanced" renders JavaScript first (5 credits per URL with an API key; with x402 the same $0.005 per URL as basic).
formatSupported"markdown" (default) or "text".
include_usageSupportedusage.credits reports FastAF credits used (API key only).
include_faviconNot supportedAccepted; favicon is null.
include_imagesNot supportedAccepted; images is always an empty list.
query, chunks_per_sourceIgnoredThe whole page is returned, not reranked chunks.
timeoutIgnoredAccepted, like any unknown field, so existing calls keep working, with no effect on the results.

The response has results (url, raw_content, images), failed_results (url, error), response_time and request_id. Private addresses and login pages are refused, as on every FastAF endpoint.

What is not supported?

  • The /crawl, /map, /research and /usage endpoints.
  • Generated answers, images, and news or finance topics: topic is accepted but every search is a Google web search. For news, use the Google News API.
  • Keyless mode. Without a key the SDKs send no credentials and get 401.

How do errors look?

Errors use Tavily's format, {"detail": {"error": "..."}}, with a FastAF code next to the message. The status codes match what the SDKs expect: 400 for invalid input, 401 for a missing or wrong key, 403 for a suspended account or an unverified email, 429 for rate limits (with Retry-After), and 432 when the account has no credits left. In Python they raise BadRequestError, InvalidAPIKeyError, ForbiddenError and UsageLimitExceededError. Temporary failures of the data source return 502 or 503 and are not charged.

How do you start?

Create an account: your API key arrives by email, and you get 500 free credits every month after you verify your address. Then pay per call, with credits or x402. See an example output with ?sample=1 (search, page content, in the FastAF format); you only pay for 200 responses. Building with a framework instead of the Tavily SDK? See the LangChain, OpenAI Agents SDK and Vercel AI SDK integrations. More options are on the integrations page and in the documentation; for how the two services differ, see FastAF vs Tavily.

FAQ

Is FastAF a drop-in Tavily alternative?

For /search and /extract, yes: keep tavily-python or @tavily/core, set the base URL to https://api.fastaf.co/tavily and use a FastAF key. /crawl, /map and /research are not supported.

Do I need to change my code?

Only the API key and the base URL: api_base_url in Python (TavilyClient and AsyncTavilyClient), apiBaseURL in JavaScript (tavily({ apiKey, apiBaseURL })).

How much does it cost?

One search costs the same as a FastAF SERP call ($0.003 with x402, or 5 credits with an API key). See FastAF vs Tavily.

Can I test before paying?

See an example output with ?sample=1 on the SERP and scrape endpoints; you only pay for 200 responses. After email verification you get 500 free credits every month (a search is 5 credits).

Is FastAF affiliated with Tavily?

No. It is compatible with the request format only.

Tavily is a trademark of its respective owner. FastAF is not affiliated with, endorsed by or sponsored by Tavily. "Compatible" means that FastAF accepts the same request format; it does not imply any partnership.