youtube-trends-api
v1.1.0
Published
YouTube has no public trends API. This package gives you YouTube search interest data over time via a single POST endpoint. Weekly series, growth percentages, and live YouTube trending. No scraping. Powered by trendsmcp.ai
Maintainers
Readme
youtube-trends-api
YouTube has no public trends API. This package gives you YouTube search interest data over time via a single POST endpoint. Weekly series, growth percentages, and live YouTube trending. No scraping.
Get your free API key at trendsmcp.ai — 100 requests/month, no credit card.
Install
npm install youtube-trends-apiQuick start
import { TrendsMcpClient } from "youtube-trends-api";
const client = new TrendsMcpClient({ apiKey: "YOUR_API_KEY" });
// ~5 years of weekly time series
const series = await client.getTimeSeries({
source: "youtube",
keyword: "asmr",
});
console.log(series[0]);
// { date: "2026-03-21", value: 72, volume: null, keyword: "asmr", source: "youtube" }
// Period-over-period growth
const growth = await client.getGrowth({
source: "youtube",
keyword: "asmr",
percent_growth: ["3M", "1Y"],
});
console.log(growth.results[0]);
// { period: "3M", growth: 14.5, direction: "increase", ... }
// What's trending right now
const trending = await client.getTopTrends({ limit: 10 });
console.log(trending.data);
// [[1, "topic one"], [2, "topic two"], ...]Methods
getTimeSeries(params) / getTrends(params)
Returns ~5 years of weekly historical data for a keyword. Prefer getTimeSeries.
getGrowth(params)
Calculates percentage growth between two points in time. Pass preset strings ("3M", "1Y", "YTD", etc.) or custom date pairs. Omitting percent_growth defaults to ["12M"].
Growth presets: 7D 14D 30D 1M 2M 3M 6M 9M 12M 1Y 18M 24M 2Y 36M 3Y 48M 60M 5Y MTD QTD YTD
getTopTrends(params?)
Returns today's live trending items. Omit type to get all feeds at once. Supports category, limit, and offset.
All supported sources
This package exposes the full TrendsMcpClient — all sources work, not just youtube:
| 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" | Subreddit subscribers (name only, no r/) |
| "amazon" | Amazon product search volume |
| "wikipedia" | Wikipedia page views |
| "news volume" | News article mention volume |
| "news sentiment" | News sentiment score |
| "app downloads" | Android app downloads (bundle ID) |
| "app rankings" | Android app rankings (bundle ID) |
| "npm" | npm package weekly downloads |
| "steam" | Steam concurrent players |
Error handling
import { TrendsMcpClient, TrendsMcpError } from "youtube-trends-api";
try {
const series = await client.getTimeSeries({ source: "youtube", keyword: "asmr" });
} catch (err) {
if (err instanceof TrendsMcpError) {
console.error(err.status); // 429
console.error(err.code); // "rate_limited"
console.error(err.message);
}
}Links
License
MIT
