YouTube has no public trends API. This package gives you YouTube search interest data over time via a single call. Weekly series, growth percentages, and live trending searches. No scraping. Powered by trendsmcp.ai
Project description
youtube-trends-api
The number one Python package for YouTube trend data. YouTube has no public trends API. This package gives you YouTube search interest over time via a single REST call. Weekly series, growth percentages, and live trending searches. No scraping, no YouTube API key, no OAuth.
Works as a Python API client in any script, notebook, or pipeline. Also works as an MCP tool — plug it directly into Claude, Cursor, VS Code Copilot, or any MCP-compatible AI host.
Powered by trendsmcp.ai.
Get a free API key — 100 requests/month, no credit card.
Requirements
Python 3.8 or later. Depends on trendsmcp.
Install
pip install youtube-trends-api
Connect
Store your API key in an environment variable:
export TRENDSMCP_API_KEY="your-api-key"
import os
from youtube_trends_api import TrendsMcpClient, SOURCE
client = TrendsMcpClient(api_key=os.environ["TRENDSMCP_API_KEY"])
SOURCE is pre-set to "youtube". Pass it directly to any method.
get_trends
Returns a weekly time series for a YouTube keyword. Default is 5 years of weekly data.
import os
from youtube_trends_api import TrendsMcpClient, SOURCE
client = TrendsMcpClient(api_key=os.environ["TRENDSMCP_API_KEY"])
series = client.get_trends(source=SOURCE, keyword="asmr")
print(series[0])
# TrendsDataPoint(date='2021-01-03', value=54, keyword='asmr', source='youtube')
print(series[-1])
# TrendsDataPoint(date='2026-03-23', value=72, keyword='asmr', source='youtube')
# Daily granularity (last 30 days)
series = client.get_trends(source=SOURCE, keyword="asmr", data_mode="daily")
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source |
str | Yes | Use SOURCE or pass any supported source string |
keyword |
str | Yes | Keyword to query |
data_mode |
str | No | "weekly" (default) or "daily" |
Response fields
| Field | Type | Description |
|---|---|---|
date |
str | ISO date string |
value |
float | Normalized value 0 to 100 |
volume |
float or None | Absolute volume estimate where available |
keyword |
str | The keyword queried |
source |
str | The data source |
get_growth
Returns period-over-period growth percentages for a keyword.
growth = client.get_growth(
source=SOURCE,
keyword="asmr",
percent_growth=["3M", "12M", "YTD"],
)
for r in growth.results:
print(f"{r.period}: {r.growth:+.1f}% ({r.direction})")
# 3M: +8.2% (increase)
# 12M: +14.5% (increase)
# YTD: +5.1% (increase)
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 ranges:
from youtube_trends_api import TrendsMcpClient, SOURCE, CustomGrowthPeriod
import os
client = TrendsMcpClient(api_key=os.environ["TRENDSMCP_API_KEY"])
growth = client.get_growth(
source=SOURCE,
keyword="asmr",
percent_growth=[
CustomGrowthPeriod(name="last quarter", recent="2026-03-31", baseline="2026-01-01")
],
)
get_top_trends
Returns today's live trending YouTube searches.
trending = client.get_top_trends(type="YouTube", limit=10)
print(trending.data)
# [[1, 'topic one'], [2, 'topic two'], ...]
Async
All three methods are available on AsyncTrendsMcpClient:
import asyncio
import os
from youtube_trends_api import AsyncTrendsMcpClient, SOURCE
async def main():
client = AsyncTrendsMcpClient(api_key=os.environ["TRENDSMCP_API_KEY"])
series = await client.get_trends(source=SOURCE, keyword="asmr")
print(series[-1])
asyncio.run(main())
Error handling
from youtube_trends_api import TrendsMcpClient, TrendsMcpError, SOURCE
import os
client = TrendsMcpClient(api_key=os.environ["TRENDSMCP_API_KEY"])
try:
series = client.get_trends(source=SOURCE, keyword="asmr")
except TrendsMcpError as e:
print(e.status) # HTTP status code, e.g. 429
print(e.code) # e.g. "rate_limited"
print(e.message)
Supported sources
This package defaults to "youtube" but the client supports all sources.
| source | What it measures |
|---|---|
"google search" |
Google Search volume |
"google images" |
Google Images search volume |
"google news" |
Google News search volume |
"google shopping" |
Google Shopping purchase intent |
"youtube" |
YouTube search volume |
"tiktok" |
TikTok hashtag volume |
"reddit" |
Reddit mention and discussion volume |
"amazon" |
Amazon product search volume |
"wikipedia" |
Wikipedia page views |
"news volume" |
News article mention count |
"news sentiment" |
News sentiment score (positive / negative) |
"npm" |
npm package weekly downloads |
"steam" |
Steam concurrent player count |
See trendsmcp.ai/docs for the full and always up-to-date source list.
Related packages
- trendsmcp - core package, all sources
- youtube-trends-mcp - MCP variant of this package
- reddit-trends-api / reddit-trends-mcp
- google-search-trends-api / google-search-trends-mcp
- amazon-trends-api / amazon-trends-mcp
- tiktok-trends-api / tiktok-trends-mcp
- wikipedia-trends-api / wikipedia-trends-mcp
- npm-trends-api / npm-trends-mcp
- steam-trends-api / steam-trends-mcp
- app-store-trends-api / app-store-trends-mcp
- news-volume-api / news-volume-mcp
- news-sentiment-api / news-sentiment-mcp
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file youtube_trends_api-1.0.0.tar.gz.
File metadata
- Download URL: youtube_trends_api-1.0.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
873d8819bdadd689dd047b48da012169cc87722d43745b6597147172226ff5e4
|
|
| MD5 |
7991d9a2483e812ad74a8c1a6345d163
|
|
| BLAKE2b-256 |
3e5b7afe8a5d17ba87ae157add00474ea16426a1210b4b7de8ae311459ed5fab
|
Provenance
The following attestation bundles were made for youtube_trends_api-1.0.0.tar.gz:
Publisher:
publish.yml on trendsmcp/youtube-trends-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
youtube_trends_api-1.0.0.tar.gz -
Subject digest:
873d8819bdadd689dd047b48da012169cc87722d43745b6597147172226ff5e4 - Sigstore transparency entry: 1203557714
- Sigstore integration time:
-
Permalink:
trendsmcp/youtube-trends-api@82e200d1f141ca4af87f0653a210b3c0fe3fa655 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/trendsmcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@82e200d1f141ca4af87f0653a210b3c0fe3fa655 -
Trigger Event:
release
-
Statement type:
File details
Details for the file youtube_trends_api-1.0.0-py3-none-any.whl.
File metadata
- Download URL: youtube_trends_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e868d3b510fdc3d8b05b025ae434c01a56f9a56c0c643cfb47d7f1e7df6a94c2
|
|
| MD5 |
82f14587189a2a4b191495bf0e72594b
|
|
| BLAKE2b-256 |
ee89d91f711987db5c6f545009e87ab024937d0d80dd29298e1c5b3a4d2279ba
|
Provenance
The following attestation bundles were made for youtube_trends_api-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on trendsmcp/youtube-trends-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
youtube_trends_api-1.0.0-py3-none-any.whl -
Subject digest:
e868d3b510fdc3d8b05b025ae434c01a56f9a56c0c643cfb47d7f1e7df6a94c2 - Sigstore transparency entry: 1203557717
- Sigstore integration time:
-
Permalink:
trendsmcp/youtube-trends-api@82e200d1f141ca4af87f0653a210b3c0fe3fa655 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/trendsmcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@82e200d1f141ca4af87f0653a210b3c0fe3fa655 -
Trigger Event:
release
-
Statement type: