Skip to main content
A new key can call both. A key limited to chosen endpoints needs compat (shown as Drop-ins in the dashboard); without it the call answers 403 endpoint_not_allowed.

Tavily

POST /compat/tavily/search takes Tavily’s request body and answers in Tavily’s shape, plus a styne object with the cost, the balance and per-result dates and rights. Before:
After:
What it takes:
  • query, max_results (up to 20, billed per started block of 10), search_depth, chunks_per_source, time_range, days, start_date, end_date, include_domains and exclude_domains, language.
  • search_depth picks the mode: basic, fast, ultra-fast or none run fast; advanced runs auto. The mode served is in styne.mode.
  • Fields Styne does not act on (topic, include_answer, include_raw_content, include_images, country, exact_match, auto_parameters) are accepted and listed in styne.warnings. Unknown fields are ignored, so newer client options never break a call.
  • In the answer, score runs from 0 to 1 against the best hit, published_date is an HTTP date, usage.credits is the number of blocks billed, and styne holds cost_usd, balance_usd and per-result published_at, crawled_at, tokens and rights.
GET /compat/customsearch/v1 takes the Custom Search JSON API query string and answers in its shape, with a top-level styne object. Before:
After:
  • key may be a query parameter on this path only (also as access_token or oauth_token), as Custom Search clients send it, or a Bearer header.
  • cx is web (or empty) for the whole index, or the id of one of your saved site lists, which plays the part of the Custom Search engine. Any other cx answers 400 invalid_cx.
  • Every cse.list parameter is served; a parameter cse.list does not define answers 400, as Google does.
  • q, num (1 to 20), start (start + num at most 101), dateRestrict, siteSearch with siteSearchFilter, lr: as on Google.
  • exactTerms and excludeTerms are index filters; orTerms runs one search per term (each requiring its term) and fuses them, billed per search; hq and lowRange..highRange are appended to the query; fileType matches the result URL’s extension; linkSite searches the sites that link to that host (crawl link graph, per site).
  • gl and googlehost prefer a country’s sites; cr=countryXX keeps only them (| lists fuse one search per country); safe=active is moderate safe search; rights keeps openly licensed pages by cc_* licence trait.
  • sort=date (hard sort, dated pages only), date:a, date:d:s, date:r:YYYYMMDD:YYYYMMDD; the order applies to the returned page.
  • searchType=image answers Google’s image items from the stored content images of the ranked pages; imgSize (by pixels), imgType, imgColorType and imgDominantColor (by format and the image’s alt text, caption and file name) narrow them. byteSize is 0: Styne stores image addresses and sizes, not image bytes.
  • callback wraps the answer in JSONP; fields gives Google’s partial response (the styne object stays); hl, filter, c2coff, prettyPrint, quotaUser, userIp, relatedSite are checked and accepted.
  • Like Google, items is left out when nothing matched.

Errors

Errors keep the shape of the API being replaced and add Styne’s code and request_id.
  • Tavily: {"detail": {"error": "<message>"}, "code": "<code>", "request_id": "<id>"}.
  • Custom Search: {"error": {"code": <http status>, "message": "...", "status": "INVALID_ARGUMENT", "errors": [{"message": "...", "domain": "global", "reason": "<code>"}], "request_id": "<id>"}}. The Styne code is the reason.
The codes are the ones on Errors. Rate-limit headers and Retry-After are the same as everywhere.