SERP API: what it returns and how to choose one
A SERP API returns ranked URLs, titles, ads, and SERP features. Learn to choose: test against a live browser, compare billing units, and check failure reports.
- serp-api
- search-results
- api-testing
- pricing
- rank-tracking
On this page
- What is a SERP API and what does it return?
- How do you send a SERP API request with location, language and pagination?
- How do Google, Bing and DuckDuckGo results differ in a SERP API?
- How do you test SERP API accuracy and freshness before you buy?
- How is a SERP API billed: per request, page or credit?
- Should you build your own SERP scraper or buy a SERP API?
- Which SERP API fits a solo developer, agency, SaaS team or AI agent?
- Frequently asked questions
- Is a SERP API the same as scraping Google?
- What’s the difference between rank and absolute_rank?
- How much does a SERP API cost per 1,000 searches?
- Is using a SERP API legal?
- Why does my SERP API return an empty list?
- What should you do next when choosing a SERP API?
- Sources
A serp api runs a search on an engine and returns the results page as structured data (ranked rows, URLs, titles, ad flags, SERP features) instead of HTML. To choose one, test it: spot-check results against a real browser in the same location, check what counts as a billable unit, and see how failures are reported.
Your rank tracker or LLM agent needs search results at volume, and the parser you wrote for raw search HTML returned zero rows after a markup change. A SERP API replaces that parser, but vendor pages such as SearchAPI’s homepage headline a 99.9% success rate and don’t say how a success is counted.
After reading, you can send a request with location and pagination, read the response, run a spot-check against a live browser, compare billing units and decide between building and buying.
Key Takeaways
- Once ads appear,
rankandabsolute_rankdiverge, so check which one your provider returns.- An empty result list can mean a blocked engine. Prefer providers that name failed engines.
- Convert every price, per request, results page or credit, to cost per 1,000 results pages.
- Cache hits can still be billed, so ask each vendor for its cache window.
What is a SERP API and what does it return?
A SERP API is an HTTP endpoint that runs a search on Google, Bing, DuckDuckGo or another engine for you and returns the results page as structured data, usually JSON. Each row carries a rank, URL, title and type, so you skip proxies, CAPTCHAs and HTML parsing.

The request. SerpApi’s Google Search API docs list q as the required parameter, and it “defines the query you want to search.” The endpoint is https://serpapi.com/search?engine=google.
A request with only q=coffee names no place. A realistic one adds a location, a language, a device and a page offset, so you get the page a specific user would see. Parameter names differ by provider, so read each provider’s reference.
The response. You get one row per result. Wayfern’s SERP API page documents these row fields: rank, absolute_rank, type, an ad flag, url and engine, and shows the multi-engine version of the call.
The two rank fields count different things once ads appear; the worked check in the testing section shows the difference. Other providers use different names. SearchAPI’s example, for instance, opens with search_metadata.
Rows can be followed by SERP feature blocks, such as ads, a knowledge graph or a local pack. Coverage differs by provider. Treat knowledge graph, local pack, shopping and AI overviews as supported only when that provider’s docs name them.
Versus DIY scraping. A search page is built for people, not parsers. Each engine has its own markup and its own way of mixing ads into results, so a parser needs ongoing maintenance.
With an API you stop owning proxies, CAPTCHA handling, browser upkeep and HTML parsers. In exchange, you depend on the provider’s parser and on how it reports failure.
A blocked engine can look like an empty list, so check that failures are named. Wayfern, for example, lists them in meta.engines_failed, as its API reference documents.
How do you send a SERP API request with location, language and pagination?
You send a SERP API request to Wayfern by posting JSON to https://api.wayfern.com/api/search/v1 with a wf_ token that carries the search scope (API docs), then set lang, region, limit and start to control language, location and page.
Set the token. Create a token with the search scope and export it as WF_TOKEN. Keep it out of source files.
Send the request. This example asks Google and Bing for 20 results each, in English, for the US:
import os
import requests
URL = "https://api.wayfern.com/api/search/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['WF_TOKEN']}"}
body = {
"text": "serp api pagination",
"engines": ["google", "bing"],
"lang": "en",
"region": "us",
"limit": 20,
"start": 0,
}
resp = requests.post(URL, headers=HEADERS, json=body, timeout=60)
resp.raise_for_status()
data = resp.json()
for row in data["results"]:
print(row["absolute_rank"], row["engine"], row["url"])
print(data["meta"]["engines_failed"]) The API reference documents text at up to 512 characters and limit at 1 to 200 per engine, default 50. Other documented fields include site, filetype, date, filter and features.
The documented fields include no device parameter. If you need mobile results, treat device targeting as a screening question and check it with each provider.
Read the response. Check meta.engines_failed before you trust an empty results array. The response below is illustrative, with example.com URLs rather than live output, so confirm field placement in the reference.
{
"query": "serp api pagination",
"meta": { "request_id": "req_example", "engines_failed": [] },
"took_ms": 123,
"results": [
{
"rank": 1,
"absolute_rank": 1,
"type": "organic",
"url": "https://example.com/page-one",
"title": "Example title",
"description": "Example snippet text.",
"ad": false,
"engine": "google",
"serp_features": []
}
],
"pagination": { "page": 1, "has_more": true, "next_start": 20 }
} Follow the pagination. The limits docs list search at 30 requests a minute, so the loop sleeps between calls.
import time
rows, start = [], 0
while True:
body["start"] = start
data = requests.post(URL, headers=HEADERS, json=body, timeout=60).json()
rows.extend(data["results"])
if not data["pagination"]["has_more"]:
break
start = data["pagination"]["next_start"]
time.sleep(2) Each pass reads pagination.has_more and moves start to pagination.next_start until no pages remain.
To try it, send the request above with one of your own queries and compare the rows to a browser search in the same location. The SERP API use case page covers the rest of the workflow.
How do Google, Bing and DuckDuckGo results differ in a SERP API?
Google, Bing and DuckDuckGo return different rankings and different ad placement for the same query, so a pipeline can’t treat the engines as interchangeable. Wayfern’s search page says “Each engine has its own markup, its own operators and its own way of mixing ads into results.”
When you list several values in engines, Wayfern’s SERP API page says the engines are fetched at the same time and “duplicate URLs are merged.” Each row carries an engine field.
Failed engines are named in meta.engines_failed, so a blocked engine doesn’t pass as an empty result list.
Providers name the same ideas differently. OpenSERP’s sample response, for example, nests paging as "pagination" : { "has_more" : true , "next_start" : 10 , "page" : 1 }. For every other provider, read its docs and record the field names with the retrieval date.
Normalize once, at the edge:
# Target keys are Wayfern's names. Fill each source value from the provider's docs.
FIELD_MAP = {
"wayfern": {"rank": "rank", "absolute_rank": "absolute_rank", "ad": "ad", "snippet": "description", "next": "pagination.next_start"},
"provider_b": {"rank": "<FROM_DOCS>", "absolute_rank": "<FROM_DOCS>", "ad": "<FROM_DOCS>", "snippet": "<FROM_DOCS>", "next": "<FROM_DOCS>"},
}
def normalize(row, provider):
m = FIELD_MAP[provider]
return {k: row.get(v) for k, v in m.items()} Switching providers then changes one mapping, not your app. Measure cross-engine overlap and accuracy yourself with the spot-check in the next section.
How do you test SERP API accuracy and freshness before you buy?
You test SERP API accuracy and freshness by sending a fixed query set to the API and to a real browser in the same location, then comparing the rows by hand.
- Pick queries across four intents. Use navigational, informational, local and commercial queries that show ads in your browser.
- Fix location and language. Send the same
regionandlangyou use in the browser. Then repeat one query with two different values and confirm the rows change the way a browser in that location shows. - Record the browser SERP. Load each query in a clean window and write down the top organic URLs and every ad slot.
- Compare to the API rows. Match URLs, order and ad flags. Don’t compare against a browser you’ve logged into, because personalization will look like API error.
- Count failures yourself. An empty list is a failure. Wayfern’s SERP API page says “A blocked engine often looks like an empty result list, so failures pass silently.”
Floppydata and SearchAPI both print a 99.9% success rate on their pages. These are vendor claims with no stated method.
Define success yourself: a response with at least one parsed organic row and no failed engine.
| Criterion | How to test it | What to record |
|---|---|---|
| Result accuracy | Browser SERP versus API rows | URL and order mismatches |
| Geo-targeting | Same query, two region/lang values | Rows that changed or didn’t |
| Latency | Provider took_ms versus your wall-clock timer | Both numbers per call |
| Success rate | Your definition above | Empty lists, failed engines |
| SERP features | Query with ads, local pack, knowledge panel | Which appear in JSON |
| Engines | Run one query on each engine | Failed or missing engines |
| Cache | Repeat a query within minutes | Identical rows, billing |
| Rate limits, support | Send a burst; open a ticket | Status codes, reply time |
OpenSERP’s sample response shows the shape of a latency field: "took_ms" : 1548 in meta. Time the call yourself too, since network travel isn’t in it.
For uptime, rely only on a dated status page or SLA, and record the retrieval date. A live figure moves.
Worked check. Run one commercial query with ads. In Wayfern, rank counts organic rows only, while absolute_rank counts every row, ads included, in page order. If two ads sit above the first organic result, that result is rank 1 and absolute_rank 3.
Also check meta.engines_failed on multi-engine calls. Cached rows can be served for repeat queries, and Wayfern’s docs bill a cache hit like a fresh page, so record when each sample ran.
A small sample can’t give you a rate. It shows only whether a failure mode exists, and it says nothing about other queries, hours or volumes. Rerun it on your real queries before you commit.
How is a SERP API billed: per request, page or credit?
A SERP API bills per request, per provider results page or per credit, and one request can fetch several pages or several engines. Fill in this worksheet for each vendor before you compare prices.
| Question | Ask the vendor | Wayfern |
|---|---|---|
| Billable unit | Request, results page or credit? | Credit, per provider results page |
| Cache hits | Billed or free? | Billed |
| Failed calls | Billed or free? | See /docs/pricing |
limit and engines | How many pages does one call fetch? | Check docs first |
| Quota runs out | Overage or stop? | Hard stop at zero |
The Wayfern pricing page sets the rate at 2 credits per provider results page fetched, cache hits included.
In Wayfern’s API reference, the default engine is google, and limit runs up to 200 per engine. Check /docs/pricing for how limit and multiple engines map to provider results pages before you estimate a per-request cost.
At the $0.0125 list rate per credit, 1,000 provider results pages is 2,000 credits, which is $25.
Credit packs of 1,000 for $12.50, 5,000 for $55 and 20,000 for $200 change the effective rate. At $200 for 20,000 credits, that pack is $0.01 per credit, so 1,000 pages at 2 credits each cost $20. Prices change, so check the pricing page before you budget.
At zero credits, calls are refused and there’s no overage unless you turn on auto top-up, which is off by default.
SearchAPI’s homepage says “Pay only for successful searches”, so confirm whether failed calls bill at every vendor. Then convert each quote to cost per 1,000 provider results pages, and record the date and URL of every price you use.
Should you build your own SERP scraper or buy a SERP API?
Build your own SERP scraper when your volume is low and you control the targets; buy a SERP API when proxies, CAPTCHAs and parser upkeep cost more of your time than the API bill.
| Criterion | DIY scraper | Self-hosted open source | Managed SERP API |
|---|---|---|---|
| Cost | Engineer time, proxies | Free software, plus hosting and proxies | Per-search fee |
| Maintenance | You | You run the server | Vendor |
| Proxies | You buy and rotate | You buy and rotate | Vendor supplies |
| CAPTCHAs | You solve or avoid | You solve or avoid | Vendor handles |
| Parser upkeep | You write and fix | You update the server | Vendor |
| Legal exposure | Yours | Yours | Still yours, ask the vendor |
OpenSERP’s site is titled “Free SERP API: Self-Hosted, Open Source, 6 Search Engines” and also shows a hosted endpoint at api.openserp.org. That one project covers both the self-hosted and managed columns.
Free software still costs money. You pay for the machine it runs on and the proxies it needs. You also pay in hours when an engine changes its markup and the parser returns zero rows.
The legal row doesn’t change when you buy. Check each engine’s terms of service for its rules on automated queries. The legal position varies by jurisdiction and by use.
This isn’t legal advice, so ask a lawyer before you run queries at volume.
Our guide to web scraping tools compares tools by billing unit.
- Best for DIY scraper: a small, stable job where you own the target pages.
- Best for self-hosted open source: a team that has spare engineering hours and wants no per-search fee.
- Best for managed SERP API: a pipeline whose volume or uptime matters more than the monthly bill.
Which SERP API fits a solo developer, agency, SaaS team or AI agent?
The right SERP API depends on who runs it: a solo developer needs a simple schema, an agency needs location precision, a SaaS team needs predictable failures, and an AI agent needs ranked URLs it can scrape.
- Solo developer: Pick a flat schema and pay-as-you-go packs over monthly minimums. You want one request, one JSON shape and no contract.
- SEO agency: Prioritize location precision,
rankversusabsolute_rank, and ad capture. SearchAPI advertises “Precise coordinate-level geo-targetting”, so test any such claim against a live browser in the same city. - SaaS product: Require documented rate limits, named failure reporting and a stable schema. Your users see your outages, so a failed engine must not pass as an empty list.
- Enterprise: Ask for an SLA, named support and committed volume, and get all three in writing.
An AI pipeline, step by step:
- The agent calls a search tool with a query and a list of engines.
- The API returns ranked URLs, each tagged with its engine. OpenSERP’s normalized result carries a per-row
enginefield. - The agent scrapes the top results to markdown.
- The agent answers from the scraped text and cites those URLs.
Wayfern’s MCP server for AI agents ships search_web as one of 11 tools, at the same rates as the REST API, and every result reports credits_charged.
Where Wayfern fits, and where it doesn’t. It covers Google, Bing and DuckDuckGo only. The documented fields have no device parameter, and there is no free tier.
On Wayfern’s pricing page, search costs 2 credits per provider results page, on one balance shared with the browser and Web Data API, and the limits docs cap it at 30 requests a minute.
If you need other engines or device targeting, check other providers’ docs. If you want to test before paying, SearchAPI lists “Get 100 Free Requests”.
Frequently asked questions
Is a SERP API the same as scraping Google?
A SERP API is managed scraping behind an endpoint. The provider fetches the results page, handles proxies and blocks, parses the HTML and returns JSON. You still depend on the engine’s markup, so choose a provider that publishes how it detects failures.
What’s the difference between rank and absolute_rank?
On Wayfern’s SERP API page, rank counts organic results only. absolute_rank counts every row, ads included, in page order. Once ads appear, the two numbers diverge, so check which one your provider returns before you compare positions.
How much does a SERP API cost per 1,000 searches?
It depends on the billing unit, so convert every quote to cost per 1,000 provider results pages. At Wayfern’s list rate, 2 credits at $0.0125 each is $0.025 per page, or $25 per 1,000 pages. See current pricing.
Is using a SERP API legal?
It depends on your jurisdiction, the engine’s terms and what you do with the data. This isn’t legal advice, and no provider can guarantee compliance for you. Ask a lawyer before you build a product on it.
Why does my SERP API return an empty list?
A blocked or failed engine can look like an empty list. Check the failure field (meta.engines_failed in Wayfern’s API reference), then check whether you’re reading a cached response instead of a fresh fetch.
What should you do next when choosing a SERP API?
Choose a serp api in three passes: define success today, test this week, and confirm coverage before you commit.
Today: Write your own definition of success, such as “returns the same top 10 organic URLs as a browser in the same location.” Then list your queries and the locations each one needs.
This week: Run the spot-check against a real browser. Convert every quoted price to cost per 1,000 provider results pages, so per-request and per-credit plans sit in one unit.
Before committing: Check each provider’s docs for engine and feature coverage, how failures are reported (a named failed engine beats an empty list) and cache behavior.
To test Wayfern, create an API token with the search scope and start from the Wayfern developer docs. The honest catch: plans start at $19 a month. The cheapest entry is the Developer plan or a credit pack, and current prices are on the pricing page.
Run your query set once and keep the provider that passes your definition.
Sources
Google Search Engine Results API - SerpApi · SERP API - Google, Bing & DuckDuckGo | Wayfern · Google Search API for real-time SERP scraping · API Reference - CDP, Web Data & Search | Wayfern · Limits | Wayfern · Free SERP API: Self-Hosted, Open Source, 6 Search Engines · Pricing - Credits for Browsers & the Web Data API | Wayfern · Live Web Data for AI Agents | Wayfern. Every other source is linked where the article cites it.
See us more often in Google
One click marks Wayfern as a preferred source in Google, so our posts can show up more often in your Top Stories, AI Mode and AI Overviews.