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.
Run a search
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 hasrank,absolute_rank,type(organicorad),url,title,description,adandengine.serp_features: related queries.pagination:page,has_moreandnext_start.meta:request_id,took_msandengines_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
sitekeeps results from one domain, such asgithub.com.filetypekeeps one file type, such aspdf.- Wayfern adds both to the query as
site:andfiletype:operators. You can send them withouttext. datetakes a range,YYYYMMDD..YYYYMMDD. Wayfern sends it to Google and Bing. The DuckDuckGo request has no date filter.filter(defaulttrue) hides near-duplicate results. Wayfern sends it to Google only.langandregionset the language and market. See Localization.
{
"text": "pricing",
"site": "github.com",
"filetype": "pdf",
"date": "20260101..20261001",
"limit": 20
} Related queries
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.
| Request | Provider pages | Credits |
|---|---|---|
| Google, limit 50 | 1 | 2 |
| Google, limit 200 | up to 2 | up to 4 |
| Bing, limit 50 | up to 5 | up to 10 |
| Google and Bing, limit 10 | 2 | 4 |
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.
error | Status | Meaning |
|---|---|---|
captcha_detected | 429 | The engine showed a captcha that Wayfern could not clear |
rate_limited | 429 | The engine rate-limited the request |
blocked | 403 | The engine blocked the request |
search_timeout | 503 | The search did not finish in time |
See the Search API reference and search limits. For agents, read Search for agents.