Google SERP API
A Google SERP API turns a search query into a structured JSON document instead of a page of HTML you have to parse.
This guide explains what the endpoint accepts, what the response contains, and how to choose the right settings for a first request.
What a single SERP call returns
One request to the Google endpoint returns a JSON object rather than raw markup. The response groups search data by type, so you can read organic results, paid ads, local and map listings, news, images, related queries and related searches from the same document. A metadata block records the query context, including the number of organic results, the number of ads and the resolved search URL.
Because the output is already structured, downstream code can map fields directly into a database, spreadsheet or dashboard. The endpoint is aimed at SEO tracking, market analysis, competitor research and similar search-data workflows.
Request inputs and what each one controls
The endpoint accepts a small set of parameters. The table below maps each input to the part of the response it affects, so you can decide which ones your workflow needs before sending a request.
Input-to-output field map
Use this checklist when configuring a request. Each row pairs a parameter with the response area it shapes.
Worked example: a 'pizza' search
A request with search set to pizza returns a JSON object whose keys include knowledge_graph, local_results, meta_data, organic_results, questions, images, related_queries, related_searches, top_ads, bottom_ads, top_stories, news_results, map_results and hotel_results. Each organic result carries a position, title, url, displayed_url, domain and optional rich_snippet and sitelinks. The meta_data block records the number of organic results and ads, plus the resolved Google search URL.
This example shows why the structured output matters: a single call yields several result types that would otherwise require separate parsing logic for each SERP layout.
Telling apart the three common failure modes
Not every empty or unexpected response means the same thing. Distinguish these cases before changing your request:
- Blocked request: Google's anti-bot systems (CAPTCHAs, IP rate limiting, browser fingerprinting) can reject a request. The API handles proxy rotation and headless browser rendering to reduce this risk.
- Zero-results query: a valid query can legitimately return no organic results. The meta_data block includes a zero_results_for_original_query flag to signal this.
- Layout change: Google's result layouts change over time. The API is designed to adapt to layout changes and return clean structured JSON, but if a field you expect is missing, check the response keys before assuming a block.
Sending a first request
The endpoint is a GET request to the Google API path with an Authorization header carrying your API key. The search parameter holds the query text. The code samples below show the same request in several languages; the PHP sample is the public contract module, and the others are retained as private source-exact references.
A typical first request uses search set to a single term, then inspects the response keys to confirm which result types are present. Add search_type, country_code or extra_params only when your workflow needs them.
Credits and plan terms
Commercial terms for this endpoint are set by the operator and should be read from the current pricing page before you commit to a plan. Three questions are worth answering first: how many credits a single search consumes, whether unused credits carry over between billing periods, and how many requests can run at the same time. A worked example makes the arithmetic concrete — if a search costs 10 credits in light request mode and 15 otherwise, a monthly allowance of 75,000 credits covers roughly 7,500 light searches or 5,000 standard ones. Plan tiers, concurrency ceilings, support levels and cancellation terms vary by subscription, so treat any figure you see elsewhere as provisional until it matches the live pricing table.
Owner-confirmed performance and reputation facts
Performance and reputation figures for this service are not published on this page. Rather than repeat unverified numbers, evaluate the endpoint on evidence you can gather yourself. A practical test: send a small batch of representative queries across web, news, maps and images, then record the share that return a complete JSON document, the median response time, and how often a retry is needed. Compare those results against your own acceptance thresholds before scaling up. Questions worth putting to the provider include how success is measured, what data-protection commitments apply to scraped content, how throughput behaves during peak load, and what evidence backs any accuracy or speed claim. Customer references and ratings should likewise come from sources you can check directly.
| Parameter | What it controls | Where it shows up in the response |
|---|---|---|
| search | The text typed into the Google search bar | Drives the query; reflected in meta_data.url |
| search_type | The type of search: web, news, maps or images | Selects which result groups are populated |
| country_code | Two-letter country code for localization | Shapes geo-targeted results |
| extra_params | Additional Google parameters such as gl, hl, num, start | Passed through to the underlying search |
| light_request | Faster, cheaper request mode | Affects credit cost (10 vs 15) |
| full_html | Return the full HTML of the results plus structured output | Adds raw HTML alongside JSON |
Parameter names and descriptions reflect the captured product page; confirm current behavior against the live documentation.
Frequently asked questions
Is scraping Google Search legal?
Scraping Google can raise legal complexity because it may conflict with Google's terms of service. Review the applicable legal guidance and use the API's settings responsibly for your jurisdiction and use case.
Does Google block web scrapers?
Yes. Google uses anti-bot systems including CAPTCHAs, IP rate limiting and browser fingerprinting. The API handles these with rotating proxies, headless browsers and CAPTCHA solving so requests can return results without manual intervention.
Is it legal to scrape data from Google Finance?
Legality depends on your jurisdiction and intended use. Public financial data is generally accessible, but Google's terms of service prohibit automated collection. Consult legal counsel to confirm compliance with applicable laws and regulations.
How do I scrape Google Business listings?
Set the search query to target business information, then use the local_results or map_results sections of the response and specify country_code for geo-targeted results. The JSON includes business names, addresses, ratings and contact information.
Is scraping Google Scholar legal?
Google Scholar raises similar legal considerations to other Google services. Academic information is often public, but Google's terms of service restrict automated access. Review Google's terms and applicable copyright law, and confirm your use case complies with academic fair use and intellectual property rules.