This project provides a Node.js service for interacting with the Google Trends API. It allows you to fetch various types of data such as interest over time, interest by region, daily trends, real-time trends, related queries, and related topics.
⚠️ Update: As of now, Google no longer provides support for the Google Trends data. This may affect the functionality of this service. The code is still available for examination and use, but please be aware that some features might not work as expected.
The base URL for all API requests is: https://trend-vortex-backend.azurewebsites.net/api
The swagger documentation for the API can be found at: https://trend-vortex-backend.azurewebsites.net/api-docs/
Fetches interest data by region.
Parameters:
keyword
(required): The search term or keyword to retrieve interest data for.startTime
(optional): The start date of the time range to retrieve data for. Format:YYYY-MM-DD
.endTime
(optional): The end date of the time range to retrieve data for. Format:YYYY-MM-DD
.resolution
(optional): The level of geographic granularity. Possible values:CITY
,COUNTRY
,REGION
.
Fetches interest data over time.
Parameters:
keyword
(required): The search term or keyword to retrieve interest data for.startTime
(optional): The start date of the time range to retrieve data for. Format:YYYY-MM-DD
.endTime
(optional): The end date of the time range to retrieve data for. Format:YYYY-MM-DD
.geo
(optional): The geographic location to retrieve data for. For example,US
for United States.
Fetches real-time trending data.
Parameters:
geo
(required): The geocode for a country. For example,US
for United States orFR
for France.hl
(optional): Preferred language code for results. Defaults to English.timezone
(optional): Preferred timezone. Defaults to the timezone difference from UTC to the current locale.category
(optional): A string corresponding to a particular category to query within. Possible values:all
,e
(Entertainment),b
(Business),t
(Science/Tech),m
(Health),s
(Sports),h
(Top Stories).
Fetches related queries for a keyword.
Parameters:
keyword
(required): The search term or keyword to retrieve related queries for.startTime
(optional): The start date of the time range to retrieve data for. Format:YYYY-MM-DD
.endTime
(optional): The end date of the time range to retrieve data for. Format:YYYY-MM-DD
.geo
(optional): The geographic location to retrieve data for. For example,US
for United States.hl
(optional): Preferred language code for results. Defaults to English.timezone
(optional): Preferred timezone. Defaults to the timezone difference from UTC to the current locale.category
(optional): A number corresponding to a particular category to query within. See the category wiki for a complete list.
Fetches related topics for a keyword.
Parameters:
keyword
(required): The search term or keyword to retrieve related topics for.startTime
(optional): The start date of the time range to retrieve data for. Format:YYYY-MM-DD
.endTime
(optional): The end date of the time range to retrieve data for. Format:YYYY-MM-DD
.geo
(optional): The geographic location to retrieve data for. For example,US
for United States.hl
(optional): Preferred language code for results. Defaults to English.timezone
(optional): Preferred timezone. Defaults to the timezone difference from UTC to the current locale.category
(optional): A number corresponding to a particular category to query within. See the category wiki for a complete list.
Fetches daily trending stories.
Parameters:
geo
(required): The geocode for a country. For example,US
for United States orFR
for France.trendDate
(optional): The specific date to retrieve trending stories for. Format:YYYY-MM-DD
.