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:
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:
{
"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.
| Endpoint | Cost |
|---|---|
GET /v1/youtube/transcript | 1 credit per request |
GET /v1/youtube/video | 1 credit per request |
GET /v1/youtube/channel | 1 credit per request |
GET /v1/youtube/channel/videos | 1 credit per request |
GET /v1/youtube/channel/shorts | 1 credit per request |
GET /v1/youtube/search | 1 credit per request |
GET /v1/youtube/comments | 1 credit per 20 items requested |
Check your balance at any time, free of charge:
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:
{
"error": {
"code": "no_transcript",
"message": "This video has no captions. Nothing was charged."
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | A parameter is missing, unknown or has a value that is not allowed. The message says which one. |
| 401 | unauthorized | The API key is missing or not valid. |
| 402 | insufficient_credits | The account has fewer credits than the request costs. |
| 404 | video_not_found, channel_not_found | The video or channel does not exist, is private or is restricted. |
| 404 | no_transcript, no_results, no_shorts, no_comments, comments_disabled | The request was valid, but YouTube has nothing to return for it. |
| 429 | rate_limited | Too many requests in a short time. Retry after a moment. |
| 502 | upstream_error | YouTube did not answer this request. Retry. |
| 503 | busy | The service is at capacity. Retry in a few seconds. |
| 504 | timeout | The 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.