Google Trends Trending Realtime API Documentation
The Google Trends Trending Realtime API provides developers with access to real-time search data.
It allows for the retrieval of trending topics, search queries, related articles, and more, using the /api/v1/search?engine=google_trends_trending_realtime
endpoint.
API Parameters
Localization
-
- Name
-
geo
- Required
- Optional
- Description
-
Specifies the geographical area for the search, with the default set to
US
. For a full list of supported locations, refer to the Google Trends Trendinggeo
locations.
Filters
-
- Name
-
category
- Required
- Optional
- Description
-
Specifies the category for the search. Available options:
all
- All Categories. (Default)b
- Business.e
- Entertainment.m
- Health.t
- Sci/Tech.s
- Sports.h
- Top Stories.
Pagination
-
- Name
-
next_page_token
- Required
- Optional
- Description
-
Specifies a token for pagination, allowing you to retrieve the next set of realtime trends.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_trends_trending_realtime
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
API Examples
Real Time Trends
- Upon the initial request for real-time trends, ensure to save all returned
next_page_token
values. These tokens are crucial for accessing subsequent pages of data. - For retrieving the next set of trends, invoke the API with the
next_page_token
included as a query parameter in your request. This ensures you navigate through the paginated results correctly. - Each request for pagination may return a varying number of trending real-time searches. Within these results, each trend is uniquely identified by an
id
, such asUS_lnk_cmentQAAAADVUM_en
, ensuring precise identification and tracking of trends. - Be aware that the first request using a
next_page_token
might include duplicate entries. It's recommended to deduplicate the data based on theid
of each trend to ensure uniqueness in your dataset.
https://www.searchapi.io/api/v1/search?engine=google_trends_trending_realtime&geo=US
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_trends_trending_realtime",
"geo": "US"
}
response = requests.get(url, params = params)
print(response.text)
{
"search_metadata": {
"id": "search_8qWVwGvboYPYTAZ2gmDQJaN4",
"status": "Success",
"created_at": "2024-04-04T10:23:02Z",
"request_time_taken": 1.43,
"parsing_time_taken": 0.02,
"total_time_taken": 1.45,
"request_url": "https://trends.google.com/trends/api/realtimetrends?geo=US&hl=en-US&cat=all&fi=0&fs=0&ri=300&rs=20&sort=0&tz=-420",
"html_url": "https://www.searchapi.io/api/v1/searches/search_8qWVwGvboYPYTAZ2gmDQJaN4.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_8qWVwGvboYPYTAZ2gmDQJaN4"
},
"search_parameters": {
"engine": "google_trends_trending_realtime",
"geo": "US",
"category": "all"
},
"realtime_trends": [
{
"id": "US_lnk_cmentQAAAADVUM_en",
"title": "Maine, Power outage, Central Maine Power Company",
"link": "https://trends.google.com/trends/trendingsearches/realtime?id=US_lnk_cmentQAAAADVUM_en&category=all&geo=US#US_lnk_cmentQAAAADVUM_en",
"queries": ["Maine", "Power outage", "Central Maine Power Company"],
"entity_links": [
{
"id": "/m/01rbhn",
"link": "https://trends.google.com/trends/explore?q=/m/01rbhn&date=now+7-d&geo=US"
}
],
"articles": [
{
"title": "Thousands without power as spring nor'easter lashes Maine",
"link": "https://www.wmtw.com/article/thousands-without-power-spring-storm-lashes-maine-cmp-versant/60390374",
"snippet": "A powerful storm moved into Maine Wednesday evening and started picking up \novernight into Thursday, bringing heavy snow and strong winds to...",
"date": "1 hour ago",
"source": "WMTW"
}
...
],
"image": {
"link": "https://www.wmtw.com/article/thousands-without-power-spring-storm-lashes-maine-cmp-versant/60390374",
"source": "WMTW",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRUcp9yMB7MWVy1Bl-CTH7o3eNdkVTfGt0nGfBp7PJl2IAI-Zl5CqacGiACvR8"
}
}
...
],
"pagination": {
"next_pages": [
{
"next_page_token": "VVNfbG5rX2t0dTV0UUFBQUFBcjdNX2VuLFVTX2xua185bXZRdFFBQUFBQW1YTV9lbixVU19sbmtfY21lbnRRQUFBQURWVU1fZW4sVVNfbG5rX1luUFZ0UUFBQUFDM1JNX2VuLFVTX2xua19yM1MtdFFBQUFBQVJRTV9lbixVU19sbmtfZUIxWHRBQUFBQUF2S01fZW4sVVNfbG5rX3VRcmR0QUFBQUFCa1BNX2VuLFVTX2xua19RNmk2dEFBQUFBRDVuTV9lbixVU19sbmtfM012bnRRQUFBQUE3X01fZW4sVVNfbG5rX1Jtdmx0UUFBQUFDalhNX2VuLFVTX2xua19TM19VdFFBQUFBQ2ZTTV9lbixVU19sbmtfYUdrV3RRQUFBQUItWE1fZW4sVVNfbG5rX2tQR2t0UUFBQUFBMHhNX2VuLFVTX2xua19YdHpTdFFBQUFBQ002TV9lbixVU19sbmtfTGpQVHRRQUFBQUQ5Qk1fZW4sVVNfbG5rX0swckd0QUFBQUFEdGZNX2VuLFVTX2xua192bVc0dFFBQUFBQUdVTV9lbixVU19sbmtfLXRQZXRRQUFBQUFrNU1fZW4sVVNfbG5rX1dTYlp0UUFBQUFDQUVNX2VuLFVTX2xua19BOTNNdFFBQUFBRFA2TV9lbg=="
}
...
]
}
}