The unofficial npm package google-trends-api is a Node layer over Google Trends. npm lists 4.9.2, last published December 2020. Weekly downloads stay high. The readme's call shape is googleTrends.apiMethod(optionsObject, [callback]). Options include keyword, startTime, endTime, geo, hl, category, and property (images, news, youtube, froogle). Methods include interestOverTime, interestByRegion, relatedQueries, relatedTopics, dailyTrends, realTimeTrends, and autoComplete. That is Explore in JavaScript. Trends API is fetch, not require. The POST is on the API reference.

require() is not a source

const googleTrends = require('google-trends-api');
googleTrends.interestOverTime({ keyword: 'air fryer' });

The function name is the widget. There is no mode. There is no source. property: 'youtube' is YouTube search interest on Trends, not the live board Trends API names as type YouTube Trending.

The readme says the library is for Node because of CORS. Putting it in a browser bundle was never the design. Putting it on a serverless function still uses that function's IP against Google.

Unofficial endpoints, already broken once

The v3-to-v4 section exists because old Trends endpoints were deprecated and throttled. The package adapted once. It has not shipped a release since 4.9.2.

GitHub issue 175 (opened Feb 2025, still discussed in 2026) reports dailyTrends returning 404 after Google retired the old daily RSS. The workaround in that thread is the new trending/rss feed, not a patched npm method. That RSS stop is on the RSS alternative.

RapidAPI listings often wrap this class of client. Shopping those listings is the RapidAPI page. The R equivalent of the same scrape class is gtrendsR.

fetch instead of the package

{
  "mode": "get_time_series",
  "source": "google search",
  "keyword": "air fryer"
}

POST that JSON to https://api.trendsapi.ai/api. Parse the response, then parse the body string. value is 0-100. For a live Google list, switch to get_top_trends and type Google Trends. For another platform, change source or type. Those strings are not npm method names.

Keep google-trends-api for a small Node script that only needs Google and can absorb a breakage. Leave when the same service must share a contract with Python or must read Amazon. The language-wide shopping list is modern pytrends replacements.