YouTube API
YouTube Screenshot
Capture a screenshot of a YouTube video at a specific timestamp.
POST
$0.01/call/v1/youtube/screenshotUsage
const res = await fetch('https://api.yepapi.com/v1/youtube/screenshot', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ id: 'dQw4w9WgXcQ', timestamp: '00:00:50' }),
});
const { data } = await res.json();
console.log(data.link);curl -X POST https://api.yepapi.com/v1/youtube/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "dQw4w9WgXcQ", "timestamp": "00:00:50"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
id | string | Yes | YouTube video ID | — |
timestamp | string | No | Time in HH:MM:SS format | 00:00:50 |
Response
{
"ok": true,
"data": {
"link": ["https://screenshot-url.jpg"],
"status": "done"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.link | string[] | Array containing the URL(s) of the captured screenshot image(s) |
data.status | string | Processing status: done when the screenshot is ready |