Skip to main content
POST
/
extract
import { Supadata } from '@supadata/js';

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

// Start extract job
const job = await supadata.extract({
  url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
  prompt: 'Extract the main topics and key takeaways',
});

// Get job results
const result = await supadata.extract.getResults(job.jobId);
console.log(result.data);
{
  "jobId": "123e4567-e89b-12d3-a456-426614174000"
}

Authorizations

x-api-key
string
header
required

Body

application/json
url
string<uri>
required

URL to any supported video media. Supports YouTube, TikTok, Instagram, Twitter/X, and Facebook videos.

Examples:

"https://www.youtube.com/watch?v=dQw4w9WgXcQ"

"https://www.tiktok.com/@user/video/1234567890"

"https://www.instagram.com/reel/ABC123"

prompt
string

Description of what data to extract from the video. Required if schema is not provided.

Example:

"Extract the main topics discussed and key takeaways"

schema
object

JSON Schema defining the structure of data to extract. Required if prompt is not provided.

Example:
{
"type": "object",
"properties": {
"topics": {
"type": "array",
"items": { "type": "string" },
"description": "Main topics discussed"
},
"summary": {
"type": "string",
"description": "Brief summary of the video"
}
},
"required": ["topics", "summary"]
}

Response

Job created for asynchronous processing

jobId
string
required

The ID of the job

Example:

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