Documentation

Every endpoint is a GET request that returns JSON. You need one API key.

Quickstart

1. Sign in to the dashboard and create an API key. A new account has 100 free credits.

2. Call an endpoint with the key in the x-api-key header:

Terminal
curl "https://pipefetch.com/v1/youtube/transcript?video=jNQXAC9IVRw" \
  -H "x-api-key: YOUR_API_KEY"

3. Read data from the answer. That is all.

Authentication

Send your key in the x-api-key header, or as Authorization: Bearer YOUR_API_KEY. Keys start with pf_. Keep them on your server: anyone who has a key can spend its credits. You can revoke a key in the dashboard at any time.

The base URL is https://pipefetch.com.

Responses

A successful answer has status 200 and this shape:

200 OK
{
  "data": { },
  "credits": { "used": 1, "remaining": 99 }
}

The same numbers are in the x-credits-used and x-credits-remaining headers. Fields that YouTube does not provide for an item are null, never missing.

Most requests answer in 2 to 7 seconds, because each one is fetched live from YouTube. Set your client's timeout to at least 90 seconds.

Credits

Only requests that return data use credits. Every error, including "not found", is free.

EndpointCost
GET /v1/youtube/transcript1 credit per request
GET /v1/youtube/video1 credit per request
GET /v1/youtube/channel1 credit per request
GET /v1/youtube/channel/videos1 credit per request
GET /v1/youtube/channel/shorts1 credit per request
GET /v1/youtube/search1 credit per request
GET /v1/youtube/comments1 credit per 20 items requested

Check your balance at any time, free of charge:

Terminal
curl "https://pipefetch.com/v1/account" \
  -H "x-api-key: YOUR_API_KEY"

Errors

An error has a 4xx or 5xx status and this shape:

404 Not Found
{
  "error": {
    "code": "no_transcript",
    "message": "This video has no captions. Nothing was charged."
  }
}
StatusCodeMeaning
400invalid_requestA parameter is missing, unknown or has a value that is not allowed. The message says which one.
401unauthorizedThe API key is missing or not valid.
402insufficient_creditsThe account has fewer credits than the request costs.
404video_not_found, channel_not_foundThe video or channel does not exist, is private or is restricted.
404no_transcript, no_results, no_shorts, no_comments, comments_disabledThe request was valid, but YouTube has nothing to return for it.
429rate_limitedToo many requests in a short time. Retry after a moment.
502upstream_errorYouTube did not answer this request. Retry.
503busyThe service is at capacity. Retry in a few seconds.
504timeoutThe request took too long. Retry.

Statuses 429, 502, 503 and 504 are safe to retry. The others will give the same answer again.

Limits

There is no daily quota. Each request returns one page of results; the maximum per request is listed with each endpoint's limit parameter. Paging beyond that is not available yet.

Endpoints

  • Transcript: The transcript of any public video with captions, as plain text, timestamped segments, SRT or WebVTT.
  • Video details: Exact views, likes and comment count, description, tags, chapters and channel for one video.
  • Channel: Subscribers, video count, description, keywords and avatar for a channel, from a handle, id or URL.
  • Channel videos: The latest uploads of a channel, newest first, with views, duration and publish time.
  • Channel Shorts: The Shorts of a channel, newest first, with view counts and thumbnails.
  • Search: YouTube search results for a query, with the same sorting and filters the site offers.
  • Comments: Top or newest comments of a video with likes, reply counts, pinned and hearted flags.