SERP API
Live search
Searches Google at the moment you call and returns the results page as JSON, usually in 2 to 4 seconds per page.
GET
https://api.scraperdata.com/v1/searchCredits
Each results page costs one credit, so
num_pages=3 costs three. Failed requests are free, and when only some pages come back you pay for those only.Send the parameters in the query string and your key in the X-API-Key header. A request can take a few seconds; use a client timeout of at least 60 seconds. To send many searches at once without waiting, add a pingback_url.
Request parameters
| Field | Type | Description |
|---|---|---|
q | string | requiredThe search query, up to 2,048 characters.Example: coffee shops |
gl | string | optionalCountry to search from, as a two-letter code.Default: usExample: in |
hl | string | optionalLanguage of the results page.Default: enExample: de |
location | string | optionalCity or region to search from, in any words. It is matched to Google's own name for the place, the country in gl first (see Location matching).Example: Austin, Texas |
google_domain | string | optionalThe Google domain to search on.Default: google.comExample: google.co.in |
type | string | optionalWhat to search for. Each type has its own list in the answer (see Result types).Values:searchnewsimagesshoppingvideosDefault: search |
page | integer | optionalThe first results page to get, starting at 1.Default: 1Example: 2 |
num_pages | integer | optionalHow many results pages to get in one request, from 1 to 10. The pages are fetched at the same time, and each one costs credits.Default: 1Example: 3 |
device | string | optionalSearch as a desktop or a phone.Values:desktopmobileDefault: desktop |
response_type | string | optionaljson for the parsed results, html for Google's own page, or both (see JSON and HTML).Values:jsonhtmlbothDefault: json |
pingback_url | string | optionalYour URL to call when the search is done. The search is queued instead of run while you wait, and the concurrency limit does not refuse it (see Queue a search).Example: https://example.com/hook |
api_key | string | optionalYour API key, if you do not send it in the X-API-Key header.Example: sd_... |
Response
A successful search returns status 200 and the JSON below. Blocks such as ads or the AI Overview are there only when Google shows them for the query.
| Field | Type | Description |
|---|---|---|
search_metadata | object | About this request. |
id | string | A unique id for the search. |
status | string | Success when Google's page came back. |
created_at | string | When the search ran, in ISO 8601. |
pages | integer | How many results pages came back. |
credits_charged | integer | Credits this request cost: one per page that came back. |
search_parameters | object | The parameters the search used, after defaults were filled in. |
q | string | The query. |
gl, hl, device, type | string | Country, language, device and search type used. |
page, num_pages | integer | The first page and how many pages were asked for. |
location_requested | string | The location you sent, when you sent one. |
location_used | string | Google's own name for the place that was searched from. |
uule | string | The location code Google got for that place. |
response_type | string | json, html or both. |
search_information | object | What Google showed about the search. |
query_displayed | string | The query as Google shows it. |
organic_results_state | string | Fully empty when Google found nothing. |
organic_results | array | The results, in order. With several pages the positions go on across pages. |
position | integer | Rank on the page, counted on across pages. |
page | integer | The results page it came from. |
title | string | The result's title. |
link | string | The page's real address, never a Google redirect. |
displayed_link | string | The address as Google prints it. |
source | string | The site's name. |
snippet | string | The text under the title. |
date | string | When Google shows a date in front of the snippet. |
thumbnail | string | The result's picture: Google's image URL, or base64 data when the page carries only that. |
rating, reviews | number, string | The stars under the result and how many reviews they count. |
sitelinks | array | Extra links under large results. |
ads, local_results, top_stories, inline_videos | array | Ads, the map pack, top stories and videos, when Google shows them (see Web results). |
related_questions, related_searches | array | People also ask, and related searches with a plain Google search link. |
knowledge_graph | object | The panel about a person, place or brand. |
ai_overview | object | Google's AI answer: its text blocks and the sources it cites (see AI Overview). |
html, html_pages | string, array | Google's own HTML, with response_type=html or both. |
Response headers
X-Credits-Charged: credits this request cost.X-Credits-Used,X-Credits-LimitandX-Credits-Left: your credits this period.X-Plan: your plan.