Search Google, Bing and DuckDuckGo

Query Google, Bing and DuckDuckGo in one call: pick engines, page through results, filter by site, file type and date, read related queries and estimate cost.

Updated

The Search API returns live result pages from Google, Bing and DuckDuckGo as one JSON envelope. This guide shows how to choose engines, page, filter, read related queries and estimate the cost.

Send POST or GET to /api/search/v1 with a wf_ API token that has the search scope.

curl -X POST https://api.wayfern.com/api/search/v1 \
  -H "Authorization: Bearer $WAYFERN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "serverless browsers",
    "engines": ["google", "bing"],
    "limit": 10
  }'

The response has these parts:

  • results: each item has rank, absolute_rank, type (organic or ad), url, title, description, ad and engine.
  • serp_features: related queries.
  • pagination: page, has_more and next_start.
  • meta: request_id, took_ms and engines_failed.

You must send at least one of text, site or filetype, or the call fails with 400. text can have up to 512 characters. The limit is 30 requests a minute.

Pick engines

engines takes google, bing and duckduckgo. The default is ["google"]. On GET, send a comma-separated list, such as engines=google,bing. GET /api/search/engines lists the engines that you can use.

Wayfern runs the engines at the same time. It merges their results and removes a result that two engines return at the same URL. If one engine fails, the others still return results, and meta.engines_failed names the failed engine. If every engine fails before it returns a result, you get an error.

Page through results

limit is the number of organic results per engine, from 1 to 200 (default 50). Wayfern fetches more provider pages when one page is not enough. Google returns up to 100 results a page. Bing and DuckDuckGo return 10.

To get the next page, send start with the value of pagination.next_start:

curl -G https://api.wayfern.com/api/search/v1 \
  -H "Authorization: Bearer $WAYFERN_API_TOKEN" \
  --data-urlencode "text=serverless browsers" \
  --data-urlencode "limit=10" \
  --data-urlencode "start=10"

next_start is start plus limit. Stop when has_more is false.

Filter results

  • site keeps results from one domain, such as github.com.
  • filetype keeps one file type, such as pdf.
  • Wayfern adds both to the query as site: and filetype: operators. You can send them without text.
  • date takes a range, YYYYMMDD..YYYYMMDD. Wayfern sends it to Google and Bing. The DuckDuckGo request has no date filter.
  • filter (default true) hides near-duplicate results. Wayfern sends it to Google only.
  • lang and region set the language and market. See Localization.
{
  "text": "pricing",
  "site": "github.com",
  "filetype": "pdf",
  "date": "20260101..20261001",
  "limit": 20
}

With features set to true, the default, serp_features holds a people_also_search block for each engine that shows one. Each item has a query and a url. Send "features": false to leave them out.

What a search costs

A search costs 2 credits for each provider page that Wayfern fetches. A page served from the search cache, which keeps results for 5 minutes, also counts. At the list rate, a page is $0.025.

RequestProvider pagesCredits
Google, limit 5012
Google, limit 200up to 2up to 4
Bing, limit 50up to 5up to 10
Google and Bing, limit 1024

If an engine shows a captcha page and Wayfern solves it, the solve debits 1 credit more. Before it runs a search, Wayfern checks that your balance can pay for the pages it expects. If not, the call fails with 402 billing_blocked.

Errors

Errors use a flat envelope: error, code, request_id, message and, for an engine failure, reason.

errorStatusMeaning
captcha_detected429The engine showed a captcha that Wayfern could not clear
rate_limited429The engine rate-limited the request
blocked403The engine blocked the request
search_timeout503The search did not finish in time

See the Search API reference and search limits. For agents, read Search for agents.