API · YouTube
POST /youtube/videos/batch
Up to 50 YouTube videos by id in one call: details and exact counts.
| Request | POST /v1/youtube/videos/batch |
| Operation id | youtube.video.batch |
| Cost | 5 credits, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
Up to 50 YouTube videos by id in one call: details and exact counts.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
ids | string[] | yes | 1 to 50 video ids or URLs. |
language | string | no | ISO 639-1 language code (en, es, pt-BR). |
Responses
| Status | Meaning | Schema |
|---|---|---|
200 | The videos, in the order asked, and the ids that did not resolve. | YouTubeVideoList |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The video, channel, playlist or post does not exist, was removed, or has nothing there. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | YouTube is temporarily unavailable. Retryable; nothing was charged. | Error |
YouTubeVideoList fields
| Field | Type | Description |
|---|---|---|
kind | "youtube#videoListResponse" | |
items | YouTubeVideo[] | |
nextPageToken | string | Pass as after for the next page. Absent on the last page. Lasts 6 hours. |
pageInfo | object | |
missing | object[] | Batch only: requested ids that did not resolve, and why. |
Errors use one shape everywhere; see Errors for every code and what to do.