Skip to main content
The /serpApi endpoint scrapes Google search results and returns normalized JSON. It handles the CAPTCHA gauntlet, ad rendering delays, and proxy rotation that make Google scraping painful.

Minimum request

Response shape

Every response carries keyword, proxyCountry, totalResults, the count fields (topAdsCount, bottomAdsCount, organicResultsCount, resultsCollected), pagesFetched (how many result pages were rendered - this is how many API requests the call was billed, see pages_to_check), the three result lists (topAds, bottomAds, organic), aiOverview and the other blocks of the page. On a country fallback it also carries requestedCountry and note (see proxy_country below).

Organic results and ads

Every organic result and ad carries these keys, [] or null when Google shows nothing for them. The Bing endpoint returns the same keys; DuckDuckGo, Yahoo and Brave return the keys up to description, so switching engines only changes the path.

aiOverview

Google’s AI-written summary above the results, or null when the search does not have one. Whether Google generates an overview depends on the query and the region, so treat this as an extra rather than a guarantee - a commercial query usually has none, an informational one usually does. A real example, trimmed, for keyword=how do solar panels work:
It is read from the page we already fetched and never waited for, so it costs you no extra time. In rare cases where the overview is still being written when the page is captured, the field is null.

Other blocks on the page

The first results page also returns Google’s other blocks. Each is an empty list ([]) or null when the search has none - which blocks Google shows depends on the query and the country. A real knowledge panel, trimmed, for keyword=barack obama:
topAds and bottomAds cover the paid units wherever Google puts them, including the blocks it now renders inside the organic column. Anything paid is in one of those two lists and never in organic.

Useful parameters

pages_to_check

How many SERP pages to scrape, 1 to 10. Defaults to 1.
Results from all pages are concatenated into topAds, bottomAds, and organic with position reflecting cross-page ordering. Billing: each result page rendered is charged as one API request - a pages_to_check=3 call that returns three pages counts as 3 requests, not 1. The pagesFetched field in the response tells you exactly how many were charged (it can be lower than pages_to_check when Google has fewer pages). /getPageSource and /getImage bill a flat 1 per request; plugins that page through results count pages the same way as /serpApi, and each plugin page says how its calls are counted.

proxy_country

Two-letter ISO code forcing the request through that country’s IP pool. Affects what Google shows you - SERP composition varies by region.
Available countries (ISO2): AT, AU, BE, BR, CA, CH, CN, CZ, DE, DK, ES, FI, FR, GB, HK, HR, IE, IT, JP, KR, LT, LU, NL, NO, NZ, PL, RO, SE, SG, TR, TW, US. The list follows our exits and can grow; a fallback’s note (below) always carries the current one. Without proxy_country the exit is picked from the whole pool, so the results can come from any of these countries and differ between calls. Set it whenever the market matters. Country fallback. If you request a country we do not have an exit for, the request does not error. The results are served from an available exit, and the JSON response carries two extra fields so you know it happened:
requestedCountry and note appear only on a country fallback. On a normal request where your proxy_country is available, neither field is present and proxyCountry echoes the country you asked for.

wait_after_load

Extra seconds to wait before extraction, on top of the wait we already do. You should not normally need it: extraction waits for the paid units to finish arriving before reading the page, so ads are not missed because of timing. Reach for this only when you have a specific reason to let a SERP settle longer - it is added to your response time as-is.

captcha_pause

Kept for compatibility; it has no effect. A CAPTCHA is handled on our side by retrying from other exits, so leave it at 0. If a country keeps answering 403, try another proxy_country.

Errors

A keyword Google genuinely has no results for is not an error: you get 200 with resultsCollected: 0 and an empty organic array. This is normal for narrow site: queries, and it means you can trust an empty result set instead of retrying it.

Tips

  • Phrase keywords like a user would. keyword=best+pizza+nyc performs differently from keyword=best%20pizza%20nyc%202026. Use spaces or +, not commas.
  • totalResults is Google’s own figure, not a count. It is the “About N results” number Google prints on the page, passed through as it is, and null when Google does not show one. Google’s figure is often far from the size of its index (for many queries it now prints a few hundred), so do not read it as how many pages match. Count what you collected with organicResultsCount.
  • Cross-page dedup is your job. If you call with pages_to_check=10, expect some overlap on borderline results. Dedup on url.