Getting Started
Get your first YouTube comment extraction working in under two minutes.
1. Get your API key
Sign up for a FetchLayer account and generate an API key from the dashboard. Free tier included — no credit card required.
2. Make your first request
Extract comments from any YouTube video by URL.
curl
bash
curl -X POST https://api.fetchlayer.dev/youtube/comments \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"videoUrl":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","sort":"top"}' 3. Understand the response
Comments come back as a flat array with nested replies. Each comment includes username, text, likes, and relative date.
json
{
"username": "@User123",
"comment": "Great video!",
"likes": 42,
"hasReplies": true,
"date": "1 day ago",
"nestedReplies": [
{
"username": "@ReplyUser",
"comment": "Agreed!",
"likes": 5,
"hasReplies": false,
"date": "1 day ago"
}
]
}