trendsapi-youtube
v1.0.1
Published
YouTube search interest trends via the Trends API. History, growth, and live YouTube trending.
Maintainers
Readme
YouTube search-interest API
JSON for how often people search YouTube, not video metadata. YouTube Data API is still the path for videos.list. This is demand.
Key: trendsapi.ai/#get-key. Full contract: trendsapi-ai/trendsapi.
Install
npm install trendsapi-youtubeimport { TrendsAPI } from "trendsapi-youtube";
const client = new TrendsAPI({ apiKey: process.env.TRENDSAPI_KEY });
const series = await client.getTimeSeries("sourdough starter");
const growth = await client.getGrowth("sourdough starter", { percent_growth: ["12M"] });
const live = await client.getLive({ limit: 15 });Keyword helpers default to source: "youtube". Override source for any other platform. Official full client: trendsapi.
Call
| Field | Value |
|---|---|
| Endpoint | POST https://api.trendsapi.ai/api |
| Auth | Authorization: Bearer $TRENDSAPI_KEY |
| History | source: youtube with get_time_series or get_growth |
| Keyword | Search phrase, e.g. sourdough starter |
| Live type | YouTube Trending |
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"}'Parsed points: {date, value, keyword, source}. value is 0-100 for this term on YouTube only.
curl -sS -X POST https://api.trendsapi.ai/api \
-H "Authorization: Bearer $TRENDSAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"get_top_trends","type":"YouTube Trending","limit":15}'type is YouTube Trending, not youtube. Feed data labels are titles, not video IDs.
No regionCode on this endpoint.
Site: trendsapi.ai/trends/youtube-trends.
License
MIT. See LICENSE.
