Trends: Explore

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}
        ]
    }'

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.

ParameterDescriptionDefault Value

source

Sets the scraper.

google_trends_explore

query

UTF-encoded keyword.

-

callback_url

URL to your callback endpoint. More info.

-

user_agent_type

Device type and browser. The full list can be found here.

desktop

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.

ParameterDescriptionDefault Value

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:

category_id

Category ID. Please refer to this file in story for a list of valid values.

-

NOTE: This service always delivers structured data - so there is no need to utilize the parse parameter with this source.

Output example

{
    "results": [
        {
            "content":"{\"interest_over_time\": [{\"keyword\": \"adidas\", \"items\": [{\"time\": \"Jan 3\ \–\ 9, 2021\", \"value\": 75}, {\"time\": \"Jan 10\ \–\ 16, 2021\", \"value\": 79}...{\"query\": \"adidas zx\", \"value\": 10, \"formatted_value\": \"10\", \"link\": \"/trends/explore?q=adidas+zx&date=2021-01-01+2022-02-02\"}]}]}",
            "created_at": "2024-02-13 11:33:21",
            "updated_at": "2024-02-13 11:33:27",
            "page": 1,
            "url": "https://trends.google.com/trends/api/explore?hl=en-US&tz=0&req=%7B%22comparisonItem%22%3A+%5B%7B%22keyword%22%3A+%22adidas%22%2C+%22geo%22%3A+%22%22%2C+%22time%22%3A+%222021-01-01+2022-02-02%22%7D%5D%2C+%22category%22%3A+0%2C+%22property%22%3A+%22%22%7D",
            "job_id": "7163133042662350849",
            "status_code": 200
        }
    ]
}

Last updated