SERP API
JSON and HTML
A search can return the parsed results, Google's own page, or both.
The response_type parameter
| Field | Type | Description |
|---|---|---|
response_type | string | optionalWhat the answer holds.Values:jsonhtmlbothDefault: json |
json: the parsed results, as described on the Live search page.html: Google's own HTML with the search details (search_metadata,search_parameters,search_information), without the parsed blocks.both: the parsed results and the HTML.
Where the HTML goes
For one results page the HTML is in html, a string. When you ask for several pages with num_pages, it is in html_pages: a list of objects with page and html.
Good to know
- The price is the same whatever you choose: one credit per results page.
- HTML answers are large, often a few hundred kilobytes per page.
- Any other value gives
400 invalid_response_typebefore anything is charged.