Quickstart
Fast, reliable API for YouTube video transcripts, metadata, playlists, channels, and search.
YTAPI lets you extract transcripts, video metadata, playlists, channel details and search results from YouTube with simple HTTP requests. It supports word-level timestamps, multiple output formats (JSON, text, Markdown, SRT, VTT), and high-concurrency batch processing.
Base URL
All API endpoints are versioned under the /v1 prefix.
Production: https://api.ytapi.dev/v1
Explore the API
Transcripts
Fetch captions and transcripts in JSON, Markdown, text, SRT, or VTT.
Video Metadata
Video details, view counts, upload dates, and channel information.
Playlists
Playlist details and video listings with cursor pagination.
Channels
Channel profiles, subscriber counts, uploads, and playlists.
Search
Search YouTube videos, channels, and playlists with autocomplete.
Batch Processing
Extract transcripts for up to 100 videos in a single request.
SDKs
Official Python and JavaScript/TypeScript clients with typed errors and retries.
Pricing
Pay-as-you-go credit packs. Credits never expire.
Credits & Billing
Per-request credit costs, rate limits, and error codes.
30-Second Quickstart
Get Your API Key
Generate an API key from the Developer Dashboard.
Make Your First Request
curl -X POST https://api.ytapi.dev/v1/transcripts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_id": "dQw4w9WgXcQ",
"format": "markdown"
}'import requests
response = requests.post(
"https://api.ytapi.dev/v1/transcripts",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"video_id": "dQw4w9WgXcQ",
"format": "markdown"
}
)
# Text formats (markdown, srt, vtt) return raw text directly
print(response.text)const res = await fetch("https://api.ytapi.dev/v1/transcripts", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
video_id: "dQw4w9WgXcQ",
format: "markdown"
})
});
// Text formats (markdown, srt, vtt) return raw text directly
const markdown = await res.text();
console.log(markdown);package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]any{
"video_id": "dQw4w9WgXcQ",
"format": "markdown",
})
req, _ := http.NewRequest("POST", "https://api.ytapi.dev/v1/transcripts", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}Prefer a client library? pip install ytapi-sdk or npm install @ytapi/sdk. See SDKs.
Parse the Response
Every response includes telemetry headers for observability:
| Header | Description |
|---|---|
X-Cache | HIT, MISS, BYPASS, or STALE — whether served from cache |
X-Track-Kind | asr (auto-generated) or manual (creator-uploaded) |
X-Track-Language | Negotiated ISO language code (e.g. en, zh-Hans) |
X-Request-Id | Unique request tracking identifier |
Features at a Glance
| Feature | Description |
|---|---|
| Transcripts | Sub-400ms median latency with automatic language fallback. Outputs JSON, plain text, Markdown, SRT, and VTT. |
| Word Timestamps | Set word_level=true for millisecond-level start and end timestamps for each word. |
| Video Metadata | Titles, descriptions, view counts, duration, publication dates, and channel details. |
| Playlists | Complete playlist details and paginated video lists using continuation tokens. |
| Channels | Channel profiles, subscriber counts, uploads, and playlists. |
| Search | Query YouTube videos, channels, and playlists with type and upload date filters. |
| Batch Processing | Submit up to 100 tasks in a single asynchronous job, executed across a concurrent worker pool (default 10, max 20). |