POST
/
youtube
/
video
/
batch
import { Supadata } from '@supadata/js';

const supadata = new Supadata({
apiKey: 'YOUR_API_KEY',
});

const batchJob = await supadata.youtube.video.batch({
videoIds: ['dQw4w9WgXcQ', 'xvFZjo5PgG0', 'L_jWHffIx5E']
// playlistId: 'PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc' // alternatively
// channelId: 'UC_9-kyTW8ZkZNDHQJ6FgpwQ' // alternatively
});
console.log(`Started batch job: ${batchJob.jobId}`);
{
  "jobId": "123e4567-e89b-12d3-a456-426614174000"
}

Authorizations

x-api-key
string
header
required

Body

application/json
videoIds
string[]
required

Array of YouTube video IDs or URLs

Example:
[
"dQw4w9WgXcQ",
"https://www.youtube.com/watch?v=xvFZjo5PgG0"
]
playlistId
string

YouTube playlist URL or ID. See supported URL formats.

Examples:

"https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"

"PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"

channelId
string

YouTube channel URL, handle or ID. See supported URL formats.

Examples:

"https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"

"https://youtube.com/c/rickastley"

"UCuAXFkgsw1L7xaCfnd5JJOw"

"@rickastley"

"rickastley"

limit
number
default:10

Maximum number of videos to process (when using playlistId or channelId)

Required range: 1 <= x <= 5000
Example:

20

Response

Successfully created a batch job

jobId
string
required

The ID of the job

Example:

"123e4567-e89b-12d3-a456-426614174000"