JSPM

trendsmcp

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q42520F
  • License MIT

Keyword trend data and growth rates via REST. Google Trends, Google Search, YouTube, Reddit, Amazon, TikTok, Wikipedia, npm, and more. Typed JS/TS client for the Trends MCP API.

Package Exports

  • trendsmcp

Readme

trendsmcp

JavaScript/TypeScript client for the Trends MCP API. Query keyword trend time series and growth percentages across Google Search, YouTube, Reddit, Amazon, TikTok, Wikipedia, npm, Steam, and more — all from a single endpoint.

Get your free API key at trendsmcp.ai — 100 requests/month, no credit card.

Install

npm install trendsmcp

Quick start

import { TrendsMcpClient } from "trendsmcp";

const client = new TrendsMcpClient({ apiKey: "YOUR_API_KEY" });

// 5-year weekly time series
const series = await client.getTrends({
  source: "google search",
  keyword: "bitcoin",
});
console.log(series[0]);
// { date: "2026-03-28", value: 47, volume: null, keyword: "bitcoin", source: "google search" }

// Period-over-period growth
const growth = await client.getGrowth({
  source: "google search",
  keyword: "nike",
  percent_growth: ["12M", "3M", "YTD"],
});
console.log(growth.results[0]);
// { period: "12M", growth: 13.64, direction: "increase", ... }

// What's trending right now
const trending = await client.getTopTrends({ type: "Google Trends", limit: 10 });
console.log(trending.data);
// [[1, "tiger woods"], [2, "miley cyrus"], ...]

Methods

getTrends(params)

Returns a historical time series for a keyword. Defaults to 5 years of weekly data. Pass data_mode: "daily" for the last 30 days.

getGrowth(params)

Calculates percentage growth between two points in time. Pass preset strings ("3M", "1Y", "YTD", etc.) or custom date pairs.

Growth presets: 7D 14D 30D 1M 2M 3M 6M 9M 12M 1Y 18M 24M 2Y 36M 3Y 48M 60M 5Y MTD QTD YTD

Custom date range:

const custom = await client.getGrowth({
  source: "amazon",
  keyword: "air fryer",
  percent_growth: [
    { name: "holiday lift", recent: "2025-12-31", baseline: "2025-10-01" }
  ],
});

getTopTrends(params?)

Returns today's live trending items. Omit type to get all feeds at once.

Available feeds: Google Trends YouTube TikTok Trending Hashtags Reddit Hot Posts Amazon Best Sellers Top Rated App Store Top Free App Store Top Paid Wikipedia Trending Spotify Top Podcasts X (Twitter) and more.

Data sources

source Description
"google search" Google search volume
"google images" Google image search volume
"google news" Google News search volume
"google shopping" Google Shopping search volume
"youtube" YouTube search volume
"tiktok" TikTok hashtag volume
"reddit" Reddit mention volume
"amazon" Amazon product search volume
"wikipedia" Wikipedia page views
"news volume" News article mention volume
"news sentiment" News sentiment score
"npm" npm package weekly downloads
"steam" Steam concurrent players

All values normalized 0–100.

Error handling

import { TrendsMcpClient, TrendsMcpError } from "trendsmcp";

try {
  const series = await client.getTrends({ source: "google search", keyword: "bitcoin" });
} catch (err) {
  if (err instanceof TrendsMcpError) {
    console.error(err.status);  // 429
    console.error(err.code);    // "rate_limited"
    console.error(err.message);
  }
}

TypeScript

Full types included. No @types package needed.

License

MIT