YouTube API
YouTube Metadata
Get live view and like counts for a YouTube video in real-time.
POST
$0.01/call/v1/youtube/metadataUsage
const res = await fetch('https://api.yepapi.com/v1/youtube/metadata', {
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.viewCount, data.likeCount);curl -X POST https://api.yepapi.com/v1/youtube/metadata \
-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 | — |
Response
{
"ok": true,
"data": {
"id": "dQw4w9WgXcQ",
"viewCount": "1762287921",
"viewCountText": "1,762,287,921 views",
"likeCount": 18936262,
"likeCountText": "18M"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.id | string | YouTube video identifier |
data.viewCount | string | Exact total view count as a numeric string |
data.viewCountText | string | Formatted view count with commas (e.g. 1,762,287,921 views) |
data.likeCount | number | Exact total number of likes |
data.likeCountText | string | Abbreviated like count (e.g. 18M) |