agentleFS
nikhonitnikhonit/social-media-api-skills/skills/youtube-api/SKILL.md

youtube-api

Skill3 starsChanged 3 months agoMIT-0View on GitHub

YouTube data toolkit via ScraperSocial — transcripts, captions and subtitles, video and channel stats, comments and replies, Shorts, search, trending and media URLs.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    The user only wants the title they already pasted: No call needed.

    line 52
  2. Distinctive:

    You need to upload, comment or manage a channel: Read-only.

    line 54
  3. Very specific:

    Every script also accepts --limit, --cursor, --fields, --format and --fresh.

    line 101
  4. Distinctive:

    Every response uses the same envelope:

    line 109

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

YouTube API skill

Read public YouTube data as clean JSON. This YouTube API skill covers the full read surface: transcripts, captions and subtitles; video and channel statistics; comment threads, top comments and replies; Shorts listings, search and trending; channel videos, live streams and playlists; search with recency and suggestion variants; and direct media URLs for audio and video files.

Transcripts are the headline use. One call turns a video into text an agent can actually reason over, and at 3 credits it is the cheapest transcript in this repo — a fraction of the Instagram or Facebook equivalents.

This skill wraps 26 live YouTube endpoints from the ScraperSocial API. Public data only, returned as clean JSON.

When to use this skill

  • A user pastes a YouTube URL and asks what the video says, or wants it summarised from the transcript.
  • You are researching a channel: subscriber counts, upload cadence, which videos performed.
  • You need comments on a video for sentiment or for surfacing recurring questions.
  • You are tracking what is trending, or searching videos, Shorts or hashtags.
  • You need a playlist's contents or a channel's live streams.

Do not use this skill when

  • A YouTube link appears in passing and the user has not asked about its contents.
  • The user only wants the title they already pasted. No call needed.
  • You need your own channel's analytics. Watch time, retention and revenue are account-scoped — use YouTube Analytics.
  • You need to upload, comment or manage a channel. Read-only.
  • You intend to redistribute the media. get_media.js --section=video-files returns file URLs for technical access; downloading and republishing content you do not own is a copyright matter and usually a terms violation. Use it for analysis, not distribution.

Setup

export SCRAPERSOCIAL_KEY=sk_live_...   # https://scrapersocial.com/app/keys

Signing up at scrapersocial.com/signup includes 100 free credits, no card required.

Permissions and scope

These scripts do exactly three things and nothing else: read one environment variable (SCRAPERSOCIAL_KEY), send HTTPS requests to https://api.scrapersocial.com (the host is a constant in the code, not configurable), and print JSON. They run as node scripts/<name>.js with no other shell use, no file writes and no persistence. call_endpoint.js accepts only the 26 documented /v1/youtube/ paths in the table below and refuses anything else before a request is made.

Scripts

ScriptWhat it doesInputCredits
get_transcript.jsGet YouTube transcript.url3 credits
get_transcript.js --section=captionsGet YouTube captions.url3 credits
get_transcript.js --section=subtitlesGet YouTube subtitles.url1 credit
get_channel.js --section=livesList YouTube channel lives.handle1 credit per stream
get_channel.js --section=searchList YouTube channel search.query2 credits per channel
get_channel.js --section=shortsList YouTube channel shorts.handle2 credits per short
get_channel.js --section=statsGet YouTube channel stats.handle2 credits
get_channel.js --section=top-videosList YouTube channel top videos.handle1 credit per video
get_channel.js --section=videosList YouTube channel videos.handle1 credit per video
get_comments.jsList YouTube comments.url1 credit per comment
get_comments.js --section=comment-repliesList YouTube comment replies.url1 credit per reply
get_comments.js --section=topList YouTube comments top.url1 credit per comment
search.jsList YouTube search.query1 credit per result
search.js --section=hashtag-searchList YouTube hashtag search.query2 credits per result
search.js --section=recentList YouTube search recent.query1 credit per result
search.js --section=streams-searchList YouTube streams search.query1 credit per stream
search.js --section=suggestionsList YouTube search suggestions.query1 credit per suggestion
get_shorts.js --section=hashtag-searchList YouTube shorts hashtag search.query2 credits per short
get_shorts.js --section=searchList YouTube shorts search.query1 credit per short
get_shorts.js --section=trendingList YouTube shorts trending.none2 credits per short
get_media.js --section=thumbnailsGet YouTube thumbnails.url1 credit
get_media.js --section=video-audioGet YouTube video audio.url3 credits
get_media.js --section=video-filesGet YouTube video files.url3 credits
get_playlist.js --section=itemsList YouTube playlist items.url1 credit per video
get_trending.jsList YouTube trending.none2 credits per video
get_stats.jsGet YouTube stats.url1 credit
call_endpoint.jsCall any /v1/youtube/ endpoint directlypath + paramsvaries

Every script also accepts --limit, --cursor, --fields, --format and --fresh. --limit is clamped to 50: above that the API returns an async job instead of data.

Example

node skills/youtube-api/scripts/search.js "transformer architecture explained"

Every response uses the same envelope:

{ "data": {}, "meta": { "count": 20, "next_cursor": "..." }, "request_id": "a18e4ef88ad4b00b" }

meta appears on paginated endpoints only. Keep request_id — support traces calls with it.

Endpoints

EndpointInputReturnsCreditsPaginated
/v1/youtube/captionsurlvideo3 creditsno
/v1/youtube/channel-liveshandlestream1 credit per streamyes
/v1/youtube/channel-searchquerychannel2 credits per channelyes
/v1/youtube/channel-shortshandleshort2 credits per shortyes
/v1/youtube/channel-statshandlechannel2 creditsno
/v1/youtube/channel-top-videoshandlevideo1 credit per videoyes
/v1/youtube/channel-videoshandlevideo1 credit per videoyes
/v1/youtube/comment-repliesurlreply1 credit per replyyes
/v1/youtube/commentsurlcomment1 credit per commentyes
/v1/youtube/comments-topurlcomment1 credit per commentyes
/v1/youtube/hashtag-searchqueryresult2 credits per resultyes
/v1/youtube/playlist-itemsurlvideo1 credit per videoyes
/v1/youtube/searchqueryresult1 credit per resultyes
/v1/youtube/search-recentqueryresult1 credit per resultyes
/v1/youtube/search-suggestionsquerysuggestion1 credit per suggestionyes
/v1/youtube/shorts-hashtag-searchqueryshort2 credits per shortyes
/v1/youtube/shorts-searchqueryshort1 credit per shortyes
/v1/youtube/shorts-trendingnoneshort2 credits per shortyes
/v1/youtube/statsurlvideo1 creditno
/v1/youtube/streams-searchquerystream1 credit per streamyes
/v1/youtube/subtitlesurlvideo1 creditno
/v1/youtube/thumbnailsurlvideo1 creditno
/v1/youtube/transcripturlvideo3 creditsno
/v1/youtube/trendingnonevideo2 credits per videoyes
/v1/youtube/video-audiourlvideo3 creditsno
/v1/youtube/video-filesurlvideo3 creditsno

Costs shown per item for paginated endpoints, per call otherwise. Failed calls are not charged.

FAQ

How do I get a YouTube transcript from a URL?

get_transcript.js with the video URL, 3 credits. --section=captions and --section=subtitles return the caption tracks instead when you need timing or a specific language.

How do I get channel statistics?

get_channel.js --section=stats with the channel handle, 2 credits. Other sections cover videos, top-videos, shorts, lives and search.

Can I get YouTube comments and their replies?

Yes. get_comments.js returns comments at 1 credit each, --section=top returns top comments, and --section=comment-replies walks the replies under one comment.

Does this cover Shorts?

Yes, separately from long-form video: get_shorts.js with --section=search, --section=trending or --section=hashtag-search.

Is this an official YouTube API?

No. ScraperSocial is independent and not affiliated with YouTube or Google. It returns publicly available data only. YouTube's own Data API is free within quota and is the sanctioned route — this is most useful for transcripts, which the official API does not straightforwardly provide.

Links

Disclaimer

ScraperSocial is an independent product and is not affiliated with, endorsed by, or sponsored by any platform named in this repository. All product names, logos and brands are property of their respective owners. These skills return only publicly available data.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.