Google can be scraped using multiple different targets, including the Google search bar, direct URL, or more specific targets like Google suggest, Google ads, etc.
Below you will find every target, whether it can be parsed to JSON, its required parameters, and ready to use code examples for cURL, Python and PHP, where you only need to change the username and password for your SERP Scraping API user for the code to work.
All Google targets support the standard scraping parameters.
Targets
google_search
Retrieve Google Search results.
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Search query. |
parse | boolean | Automatically parse results. | |
google_results_language | string | Return results in a specified language. See all options here | |
google_tbm | string | Filter search results for specific types of content (news, apps, videos...). More information here . Sample value: app | |
google_tbs | string | This parameter contains parameters, like limiting/sorting results by date. More information here . Example: qdr:w (results from last week) | |
google_safe_search | boolean | Hide explicit results. | |
other... |
google
Retrieve results from any Google service.
Parameter | Type | Required | Description |
---|---|---|---|
url | string | ✅ | A URL of a Google service. Additional parameters can be specified in the URL itself. |
parse | boolean | Automatically parse results (if a parsing strategy is available for the target url). | |
other... |
google_travel_hotels
Retrieve Google Travel service's hotel search results.
If using the
geo
parameter, you must use Google's location name format described here. Single country strings (eg.United States
) may perform poorly, while more specific locations (eg.San Francisco,California,United States
) will work better.
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Search query. |
geo | string | San Francisco,California,United States | |
adults | int | Number of adults staying. | |
children | int | Number of children staying. | |
stars | array | Filter for hotels that have the provided star rating. Example: [4,5] | |
date_range | string | Dates from and to. Example: "2022-11-10,2022-11-20" | |
other... |
google_trends_explore
Retrieve Google Trends search results.
google_shopping_search
Retrieve Google Shopping search results page by supplying your query to the query parameter.
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Search query. |
parse | boolean | Automatically parse results. | |
other... |
google_shopping_product
Retrieve Google Shopping search results using item ID supplied to the query parameter.
google_shopping_pricing
Retrieve Google Shopping page results containing offers for a specific item by supplying product ID to the query parameter.
google_images
Retrieve image links similar to the one you provided from Google Images search page.
google_suggest
Retrieve Google search term suggestions.
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Search query. |
geo | string | ✅ | Geolocation must be provided in ISO 2 format. |
other... |
google_ads
Retrieve Google search results with paid ads, if possible (not all responses include ads).
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Search query. |
parse | boolean | Automatically parse results. | |
google_tbm | string | Filter search results for specific types of content (news, apps, videos...). More information here. Sample value: app | |
google_tbs | string | This parameter contains parameters, like limiting/sorting results by date. More information here. Example: qdr:w (results from last week) | |
google_results_language | string | Return results in a specified language. See all options here | |
other... |
google_maps
Retrieve Google Maps results.
If using the
geo
parameter, you must use Google's location name format described here. Single country strings (eg.United States
) may perform poorly, while more specific locations (eg.San Francisco,California,United States
) will work better.
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Search query. |
geo | string | San Francisco,California,United States | |
page_from | string | Page to search in. Defaults to 1. | |
num_pages | string | Results in page. Defaults to 10. | |
google_results_language | string | Google results language. | |
hotel_occupancy | integer | Number of guests (only applicable if you are searching for a hotel-related search term). | |
date_range | string | Length for staying in the hotel, from - to. Example: 2024-07-12,2024-07-13 (only applicable if you are searching for a hotel-related search term). | |
google_nfpr | boolean | Auto-correction. Defaults to false. | |
other... |
google_lens
Retrieve Google Lens results. You can input the URL of any photo for search.
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | The URL of the image that you wish to search on Google Lens. Example: https://www.humanesociety.org/sites/default/files/2021-06/hamster-540188.jpg |
parse | boolean | If set to true , Scraping API will automatically parse the results. | |
other... |
Google geolocation
You can use the geo parameter with Google targets in a few different ways:
- Target using the full location name (
city,region,country
) as provided in Google CSV found here:
{
"target": "google_search",
"query": "pizza",
"geo": "London,England,United Kingdom"
}
- Target using the country name only:
{
"target": "google_search",
"query": "pizza",
"geo": "United Kingdom"
}
- Using coordinates and radius:
{
"target": "google_search",
"query": "pizza",
"geo": "lat: 32.4827, lng: -22.9384, rad: 5000"
}
There are exceptions and above formats will not work in all situations, in which case you will get an error stating that.
Updated about 2 months ago