YouTube search-interest API
YouTube search interest trends via the YouTube Trends API. History, growth, and live YouTube trending.
接入你的智能体
發布者自己的 URL。不是 PlugMCP 端點。
用我們的金鑰與日誌託管一份副本。
https://youtube.api.trendsapi.ai/mcp上方的 Claude 按鈕會開啟 Claude,並填好名稱和 URL。你仍需在那裡確認。
claude mcp add --transport http ai.trendsapi-youtube https://youtube.api.trendsapi.ai/mcpRun in a terminal.
{ "mcpServers": { "ai.trendsapi-youtube": { "command": "npx", "args": [ "-y", "mcp-remote", "https://youtube.api.trendsapi.ai/mcp" ] } }}claude_desktop_config.json
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
YouTube search interest trends via the YouTube Trends API. History, growth, and live YouTube trending.
YouTube search volume and trending videos over time. Free key at trendsapi.ai
Key: trendsapi.ai/#get-key. HTTP contract and every source: trendsapi-ai/trendsapi.
pip install trendsapi-youtube
export TRENDSAPI_KEY=your_key
Python 3.9+. Same key as the HTTP API.
from trendsapi_youtube import TrendsAPI
client = TrendsAPI() # TRENDSAPI_KEY
# client = TrendsAPI(api_key="YOUR_KEY")
Keyword helpers default to source: "youtube". Pass source= to hit any other platform with the same client. Official full client (every source, no preset): trendsapi.
source is lowercase (youtube). type is exact (YouTube Trending). Mixing them is a 400.
from trendsapi_youtube import TrendsAPI
client = TrendsAPI() # TRENDSAPI_KEY
# client = TrendsAPI(api_key="YOUR_KEY")
series = client.get_time_series("sourdough starter")
print(series[-1].date, series[-1].value)
growth = client.get_growth("sourdough starter", percent_growth=["3M", "12M"])
print(growth.results[0].growth, growth.results[0].direction)
hot = client.get_live(limit=10)
print(hot.data) # [[1, "..."], ...]
points = client.get_time_series("sourdough starter")
Each point:
Python returns list[TrendsDataPoint]. Use .date and .value, not ["date"].
JS returns the same fields as object properties.
g = client.get_growth("sourdough starter", percent_growth=["12M", "3M", "YTD"])
print(g.results[0].growth, g.results[0].direction)
percent_growth default: ["12M"]. Presets: 7D 14D 30D 1M 2M 3M 6M 9M 12M/1Y 18M 24M/2Y 36M/3Y 48M 60M/5Y MTD QTD YTD. Custom: {"name": "Launch", "recent": "2024-06-01", "baseline": "2024-01-01"}.
Several windows still count as one request. Python: growth.results[0].growth. JS: growth.results[0].growth.
hot = client.get_live(limit=10)
Python: hot.data. JS: hot.data. Optional offset= and category= (Amazon Best Sellers by Category, Top Websites only).
import asyncio
from trendsapi_youtube import AsyncTrendsAPI
async def main():
c = AsyncTrendsAPI()
return await asyncio.gather(
c.get_time_series("sourdough starter"),
c.get_time_series("sourdough starter", source="google search"),
)
asyncio.run(main())
Each 200 is one billed request.
from dataclasses import asdict
import pandas as pd
from trendsapi_youtube import TrendsAPI
df = pd.DataFrame(asdict(p) for p in TrendsAPI().get_time_series("sourdough starter"))
df["date"] = pd.to_datetime(df["date"])
print(df.set_index("date")["value"].resample("ME").mean().tail())
npm install trendsapi-youtube
Node 18+, Deno, Bun, Workers. Same API key. Field tables above apply.
import { TrendsAPI } from "trendsapi-youtube";
const client = new TrendsAPI({ apiKey: process.env.TRENDSAPI_KEY! });
const series = await client.getTimeSeries("sourdough starter");
console.log(series.at(-1)?.date, series.at(-1)?.value);
const growth = await client.getGrowth("sourdough starter", {
percent_growth: ["3M", "12M"],
});
console.log(growth.results[0].growth, growth.results[0].direction);
const live = await client.getLive({ limit: 10 });
console.log(live.data); // [[1, "..."], ...]
curl -sS -X POST https://api.trendsapi.ai/api \
-H "Authorization: Bearer $TRENDSAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"get_time_series","source":"youtube","keyword":"sourdough starter"}'
value is 0-100 for this term on YouTube only, not video metadata.type is YouTube Trending, not youtube.regionCode on this endpoint.The HTTP body field is a JSON string. SDKs decode it. Raw curl must parse body a second time.
MIT. See LICENSE.
YouTube search volume and trending videos over time. Free key at trendsapi.ai
{ "mcpServers": { "ai.trendsapi-youtube": { "url": "https://youtube.api.trendsapi.ai/mcp", "headers": {} } }}4 個工具
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 http 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
YouTube Trends API 透過 HTTP 存取。
上次檢查時間:2026-10-19。 YouTube search volume and trending videos over time. Free key at trendsapi.ai