YouTube API
Video Info
Get full video metadata without streaming URLs.
POST
$0.01/call/v1/youtube/video-infoUsage
const res = await fetch('https://api.yepapi.com/v1/youtube/video-info', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ id: 'dQw4w9WgXcQ' }),
});
const { data } = await res.json();
console.log(data.title, data.channelTitle);curl -X POST https://api.yepapi.com/v1/youtube/video-info \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "dQw4w9WgXcQ"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
id | string | Yes | YouTube video ID | — |
geo | string | No | Country code for geo-specific results | — |
lang | string | No | Language code | — |
Response
{
"ok": true,
"data": {
"id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up",
"channelTitle": "Rick Astley",
"viewCount": "1758165530",
"publishDate": "2009-10-25"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.id | string | YouTube video identifier |
data.title | string | Full video title |
data.channelTitle | string | Name of the channel that uploaded the video |
data.channelId | string | Unique identifier for the channel |
data.description | string | Full video description text |
data.viewCount | string | Total view count as a numeric string |
data.publishDate | string | Publish date in YYYY-MM-DD format |
data.thumbnail | object[] | Thumbnail images at various resolutions |
data.keywords | string[] | Tags and keywords associated with the video |
data.lengthSeconds | string | Video duration in seconds |