YouTube API

Fetch transcripts in every available language, video metadata and chapters, comments, channel details and video lists, and keyword search, as clean JSON.

Overview and use cases on the YouTube API page; response format, pagination and errors are the same for every API (conventions).

Get a transcript

GET/v1/youtube/transcripts/{video_id}1 credit / call

The transcript of a video as timed segments and plain text. Without `lang` you get the video's default caption track.

ParameterInTypeDefaultDescription
video_id*pathstring—11-character video ID
langquerystring—Language code (e.g. en, it, pt-BR); auto-translated when the video doesn't have it
formatqueryjson | text | srtjsonjson (segments + text), text or srt
curl "https://api.scrapecrate.com/v1/youtube/transcripts/dQw4w9WgXcQ" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "video_id": "dQw4w9WgXcQ",
    "language": "en",
    "is_generated": false,
    "text": "We're no strangers to love. You know the rules and so do I.",
    "segments": [
      {
        "text": "We're no strangers to love",
        "start": 18.6,
        "duration": 3.2
      },
      {
        "text": "You know the rules and so do I",
        "start": 22.4,
        "duration": 4.1
      }
    ]
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}

List transcript languages

GET/v1/youtube/transcripts/{video_id}/languages1 credit / call

The caption tracks available for a video, manual and auto-generated.

ParameterInTypeDefaultDescription
video_id*pathstring—11-character video ID
curl "https://api.scrapecrate.com/v1/youtube/transcripts/dQw4w9WgXcQ/languages" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "video_id": "dQw4w9WgXcQ",
    "languages": [
      {
        "language_code": "en",
        "language": "English",
        "is_generated": false,
        "is_translatable": true
      },
      {
        "language_code": "it",
        "language": "Italian",
        "is_generated": true,
        "is_translatable": true
      }
    ]
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}

Get video metadata

GET/v1/youtube/videos/{video_id}1 credit / call

Title, description, channel, duration, views, likes, comment count, tags and categories.

ParameterInTypeDefaultDescription
video_id*pathstring—11-character video ID
curl "https://api.scrapecrate.com/v1/youtube/videos/dQw4w9WgXcQ" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "video_id": "dQw4w9WgXcQ",
    "title": "Never Gonna Give You Up",
    "description": "The official video.",
    "channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "channel_name": "Rick Astley",
    "duration": 213,
    "view_count": 1600000000,
    "like_count": 18000000,
    "comment_count": 2400000,
    "upload_date": "2009-10-25",
    "thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
    "tags": [
      "rick astley",
      "never gonna give you up"
    ],
    "categories": [
      "Music"
    ]
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}

Get video chapters

GET/v1/youtube/videos/{video_id}/chapters1 credit / call

The chapters of a video with start and end times in seconds.

ParameterInTypeDefaultDescription
video_id*pathstring—11-character video ID
curl "https://api.scrapecrate.com/v1/youtube/videos/dQw4w9WgXcQ/chapters" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "video_id": "dQw4w9WgXcQ",
    "has_chapters": true,
    "chapters": [
      {
        "title": "Intro",
        "start_time": 0,
        "end_time": 18
      },
      {
        "title": "Verse 1",
        "start_time": 18,
        "end_time": 43
      }
    ]
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}

List video comments

GET/v1/youtube/videos/{video_id}/comments1 credit / 100 items

Top-level comments of a video with author, likes, replies count, date and pinned flag.

ParameterInTypeDefaultDescription
video_id*pathstring—11-character video ID
sortquerytop | newtopTop comments or newest first
limitqueryinteger (1–100)50Comments per page (max 100)
cursorquerystring—pagination.next_cursor of the previous page
curl "https://api.scrapecrate.com/v1/youtube/videos/dQw4w9WgXcQ/comments" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": [
    {
      "comment_id": "UgzX1a2b3c4d5e6f7g8h",
      "text": "Still a classic.",
      "author": "@musicfan",
      "like_count": 1520,
      "reply_count": 12,
      "published_at": "2024-03-01T10:00:00Z",
      "is_pinned": false
    }
  ],
  "pagination": {
    "next_cursor": "eyJwIjoyfQ",
    "has_more": true
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}

Get a channel

GET/v1/youtube/channels/{channel_id}1 credit / call

Channel details by channel ID (`UC...`) or @handle.

ParameterInTypeDefaultDescription
channel_id*pathstring—Channel ID (UC...) or @handle
curl "https://api.scrapecrate.com/v1/youtube/channels/%40RickAstleyYT" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "name": "Rick Astley",
    "description": "The official channel.",
    "subscriber_count": 4100000,
    "video_count": 320,
    "thumbnail_url": "https://yt3.ggpht.com/example.jpg",
    "channel_url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}

List channel videos

GET/v1/youtube/channels/{channel_id}/videos1 credit / call

The videos of a channel, newest first, page by page.

ParameterInTypeDefaultDescription
channel_id*pathstring—Channel ID (UC...) or @handle
include_shortsquerybooleanfalseInclude Shorts
limitqueryinteger (1–100)30Videos per page (max 100)
cursorquerystring—pagination.next_cursor of the previous page
curl "https://api.scrapecrate.com/v1/youtube/channels/%40RickAstleyYT/videos" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": [
    {
      "video_id": "dQw4w9WgXcQ",
      "title": "Never Gonna Give You Up",
      "duration": 213,
      "view_count": 1600000000,
      "published_at": "2009-10-25",
      "thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
    }
  ],
  "pagination": {
    "next_cursor": "eyJwIjoyfQ",
    "has_more": true
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}
GET/v1/youtube/search1 credit / call

Search by keyword and get videos with channel, duration, views and upload date.

ParameterInTypeDefaultDescription
q*querystring—Search query
limitqueryinteger (1–50)20Results (max 50)
curl "https://api.scrapecrate.com/v1/youtube/search?q=lofi%20hip%20hop" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "data": [
    {
      "video_id": "jfKfPfyJRdk",
      "title": "lofi hip hop radio",
      "channel_name": "Lofi Girl",
      "channel_id": "UCSJ4gkVC6NrvII8umztf0Ow",
      "duration": 0,
      "view_count": 900000000,
      "upload_date": "2022-07-12",
      "thumbnail_url": "https://i.ytimg.com/vi/jfKfPfyJRdk/hqdefault.jpg"
    }
  ],
  "pagination": {
    "next_cursor": "eyJwIjoyfQ",
    "has_more": true
  },
  "meta": {
    "request_id": "req_8f2c1a9b0d3e4f5a6b7c",
    "credits_used": 1,
    "credits_remaining": 9999
  }
}