Google Trends API Documentation | Google Trends API

API Base URL

https://google-trends21.p.rapidapi.com

x-rapidapi-host: google-trends21.p.rapidapi.com

x-rapidapi-key: YOUR_API_KEY

Google Trends Documentation Overview

The Google Trends API from CognifyAPI provides programmatic access to trending topics, keyword interest over time, regional data, and keyword comparisons, mirroring features from the official Google Trends tool.

Google Trends Interface Overview

2. Get Explore Top/Rising Searched Queries

Fetch top and rising queries related to a specific country, category, and time range.Explore Search Queries helps you discover the most popular and rising search queries related to a keyword. You can filter by country, time range, and category to analyze user interests, track emerging trends, and gain insights into what people are searching for online.

GET/getExploreSearchQueries

Parameters

ParameterTypeRequiredDescription
countrystringYesCountry Code (e.g., US)
timeintNoHours (Default: 24)
categoryintNoCategory ID (Default 0 = all categories).
hlstringNoLanguage (e.g., `en-US`, Default: `en-US`).
tzintNoTimezone offset in minutes (e.g., `300` = UTC-5, Default:`300`)

Request Example

bash
curl --request GET \
--url 'https://google-trends21.p.rapidapi.com/getExploreSearchQueries?country=US&time=today%2012-m&category=0&hl=en-US&tz=300' \
--header 'x-rapidapi-host: google-trends21.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_API_KEY'

Response Example

json
{
  "searchQueries": {
    "default": {
      "top": [
        {
          "query": "weather",
          "value": 100,
          "formattedValue": "100",
          "hasData": true,
          "link": "/trends/explore?q=weather&date=today+12-m&geo=US"
        },
        {
          "query": "google",
          "value": 90,
          "formattedValue": "90",
          "hasData": true,
          "link": "/trends/explore?q=google&date=today+12-m&geo=US"
        }
      ],
      "rising": [
        {
          "query": "labubu",
          "value": 1700,
          "formattedValue": "+1,700%",
          "link": "/trends/explore?q=labubu&date=today+12-m&geo=US"
        },
        {
          "query": "tiempo de mañana",
          "value": 300,
          "formattedValue": "+300%",
          "link": "/trends/explore?q=tiempo+de+ma%C3%B1ana&date=today+12-m&geo=US"
        }
      ]
    }
  }
}

3. Get Explore Search Term

Explore Search Term lets you analyze the popularity of specific keywords across time, regions, and categories. By entering a search term, you can view interest trends, compare multiple queries, filter by country, category, or time range, and discover related topics and rising queries.

GET/getExploreSearchTerm

Parameters

ParameterTypeRequiredDescription
keywordstringYesThe main search term you want to analyze (e.g., trump).
countrystringNoCountry Code (e.g., US)
timeintNoHours (Default: 24)
categoryintNoCategory ID (Default 0 = all categories).
hlstringNoLanguage (e.g., `en-US`, Default: `en-US`).
tzintNoTimezone offset in minutes (e.g., `300` = UTC-5, Default:`300`)

Request Example

bash
curl --request GET \
--url 'https://google-trends21.p.rapidapi.com/getExploreSearchTerm?keyword=trump&country=US&time=today%2012-m&category=0&hl=en-US&tz=300' \
--header 'x-rapidapi-host: google-trends21.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_API_KEY'

Response Example

json
{
  "relatedQueries": {
    "default": {
      "top": [
        {
          "query": "donald trump",
          "value": 100,
          "formattedValue": "100",
          "hasData": true,
          "link": "/trends/explore?q=donald+trump&date=today+12-m&geo=US"
        }
      ],
      "rising": [
        {
          "query": "trump zelensky meeting",
          "value": 15350,
          "formattedValue": "Breakout",
          "link": "/trends/explore?q=trump+zelensky+meeting&date=today+12-m&geo=US"
        }
      ]
    }
  },
  "interestByRegion": {
    "default": {
      "geoMapData": [
        {
          "coordinates": {
            "lat": 38.9071923,
            "lng": -77.0368707
          },
          "geoName": "Washington",
          "value": [
            0
          ],
          "formattedValue": [
            ""
          ],
          "maxValueIndex": 0,
          "hasData": [
            false
          ]
        }
      ]
    }
  },
  "interestByOverTime": {
    "default": {
      "timelineData": [
        {
          "time": "1723939200",
          "formattedTime": "Aug 18 – 24, 2024",
          "formattedAxisTime": "Aug 18, 2024",
          "value": [
            18
          ],
          "hasData": [
            true
          ],
          "formattedValue": [
            "18"
          ]
        }
      ],
      "averages": []
    }
  }
}

Error Handling & Limits

The API uses standard HTTP status codes. Exceeding the allowed rate limit will result in a429 Too Many Requests response.

  • 200Success
  • 400Invalid Parameters
  • 429Rate Limit Exceeded