Google SERP API

This endpoint will retrieve product data from an Google search result page and transform it into usable JSON.

<?php
$url =
"https://api.scraperapi.com/structured/google/search?api_key=API_KEY&query=QUERY&country_code=COUNTRY_CODE&tld=TLD"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,
TRUE); curl_setopt($ch, CURLOPT_HEADER,
FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,
0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,
0); $response = curl_exec($ch); curl_close($ch); print_r($response);

The Google Structured Data endpoint supports several parameters:

ParameterDetails

API_KEY

User's normal API Key

QUERY

Query keywords that a user wants to search for

COUNTRY_CODE

Where a google domain needs to be scraped from another country (e.g. scraping google.com from Canada to get Canadian results), specify the TLD as well as the COUNTRY_CODE parameters. Valid values are valid TLDs (e.g. “.com.au”, “.es”, etc.).

TLD

Country of Google domain to scrape. This is an optional argument and defaults to “us” (google.com). Valid values include: us: 'google.com', uk: 'google.co.uk', ca: 'google.ca', de: 'google.de', es: 'google.es', fr: 'google.fr', it: 'google.it', jp: 'google.co.jp', in: 'google.in', cn: 'google.cn', sg: 'google.com.sg', mx: 'google.com.mx', ae: 'google.ae', br: 'google.com.br', nl: 'google.nl', au: 'google.com.au', tr: 'google.com.tr', sa: 'google.sa', se: 'google.se', pl: 'google.pl'

Google parameters

We also support Google Search parameters for this endpoint. Examples: UULE: Set a region for a search. For example: w+CAIQICINUGFyaXMsIEZyYW5jZQ. You can find an online UULE generator here: https://site-analyzer.pro/services-seo/uule/ NUM: Number of results HL: Host Language. For example: DE GL: Boosts matches whose country of origin matches the parameter value. For example: DE IE: Character encoding how the engine interpret the query string. For example: UTF8 OE: Character encoding used for the results. For example: UTF8 START: Set the starting offset in the result list. When start=10 set the first element in the result list will be the 10th search result (meaning it starts with page 2 of results if the "num" is 10)

Last updated