Skip to main content
This tutorial walks you through sending a synchronous request to each Bright Data YouTube Scraper API endpoint. By the end, you’ll have working examples for channels, videos, and comments.

Prerequisites

Request structure

Every synchronous request follows the same pattern:
POST https://api.brightdata.com/datasets/v3/scrape?dataset_id={DATASET_ID}&format=json
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

[{"url": "https://www.youtube.com/..."}]
The only thing that changes between endpoints is the dataset_id and the input URL format.
Synchronous requests support up to 20 URLs and have a 1-minute timeout. If the request takes longer, the API automatically returns a snapshot_id instead. See async requests.

Channels

Dataset ID: gd_lk538t2k2p1k3oos71
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lk538t2k2p1k3oos71&format=json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.youtube.com/@MrBeast"}]'
You should see a 200 response. This takes 10-30 seconds.
[
  {
    "channel_name": "MrBeast",
    "channel_url": "https://www.youtube.com/@MrBeast",
    "subscribers": 358000000,
    "total_videos": 850,
    "total_views": 50000000000,
    "description": "...",
    "is_verified": true
  }
]
Full Channels response schema

Videos

Dataset ID: gd_lk56epmy2i5g7lzu0k
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lk56epmy2i5g7lzu0k&format=json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}]'
[
  {
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up",
    "channel_name": "Rick Astley",
    "views": 1500000000,
    "likes": 16000000,
    "date_posted": "2009-10-25T00:00:00.000Z",
    "duration": "3:33",
    "description": "...",
    "num_comments": 2700000
  }
]
Full Videos response schema

Comments

Dataset ID: gd_lk9q0ew71spt1mxywf
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lk9q0ew71spt1mxywf&format=json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}]'
[
  {
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "comment_user": "user123",
    "comment_user_url": "https://www.youtube.com/@user123",
    "comment_date": "2024-04-05T12:30:00.000Z",
    "comment": "This song never gets old!",
    "likes": 250,
    "replies": 12,
    "comment_id": "UgyKz0..."
  }
]
Full Comments response schema

Quick reference: dataset IDs

EndpointDataset IDURL pattern
Videosgd_lk56epmy2i5g7lzu0kyoutube.com/watch?v={video_id}
Channelsgd_lk538t2k2p1k3oos71youtube.com/@{handle}
Commentsgd_lk9q0ew71spt1mxywfyoutube.com/watch?v={video_id}

Output formats

Control the response format with the format query parameter:
ValueDescription
jsonJSON array (default)
ndjsonNewline-delimited JSON, one record per line
csvComma-separated values

Next steps

Async batch requests

Scrape hundreds of URLs in a single batch job.

API reference

Full parameter and response field reference.