Trends: Explore
Extract Google Trends data by keyword, date range, and category. API supports multiple search types and filtering.
The google_trends_explore source is designed to retrieve Google Trends results.
Due to ongoing issues, the scraped data may not be 100% accurate compared to direct usage on Google Trends via web browsers. Please use it with caution and be aware of potential discrepancies.
Request samples
In this example, we make a request to get trends results for a search term adidas between the 1st of January, 2021 and the 2nd of February, 2022, and set the category to "Arts & Entertainment" (category id: 3).
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "google_trends_explore",
"query": "adidas",
"context": [
{"key": "date_from", "value": "2021-01-01"},
{"key": "date_to", "value": "2022-02-02"},
{"key": "category_id", "value": 3}
]
}'import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_trends_explore',
'query': 'adidas',
'context': [
{'key': 'date_from', 'value': '2021-01-01'},
{'key': 'date_to', 'value': '2022-02-02'},
{'key': 'category_id', 'value': 3},
],
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.
Request parameter values
Generic
Basic setup and customization options for scraping Google Trends results.
source
Sets the scraper.
google_trends_explore
query
The keyword or phrase to search for.
-
geo_location
The geographical location that the result should be adapted for. With Google Trends: Explore, we accept 2-letter ISO country codes as geo_location parameter values.
-
- mandatory parameter
Filtering
Advanced options for tailoring and refining the search context.
context:
search_type
Lets you set the search type (one of the options on Google Trends GUI). Possible values: web_search, image_search, google_shopping, youtube_search.
web_search
context:
date_from
The lower date bracket. Format: YYYY-MM-DD. Oldest possible date: 2004-01-01.
-
context:
date_to
The upper date bracket. Format: YYYY-MM-DD. Oldest possible date: 2004-01-01.
-
Context parameters
All context parameters should be added to the context array as objects with key and value pairs, e.g.:
Output example
Last updated
Was this helpful?

