Get YouTube video metadata
curl --request POST \
--url https://{deployment}/api/v1/youtube/metadata \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"video_id": "dQw4w9WgXcQ"
}
'import requests
url = "https://{deployment}/api/v1/youtube/metadata"
payload = { "video_id": "dQw4w9WgXcQ" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({video_id: 'dQw4w9WgXcQ'})
};
fetch('https://{deployment}/api/v1/youtube/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{deployment}/api/v1/youtube/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'video_id' => 'dQw4w9WgXcQ'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{deployment}/api/v1/youtube/metadata"
payload := strings.NewReader("{\n \"video_id\": \"dQw4w9WgXcQ\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{deployment}/api/v1/youtube/metadata")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"video_id\": \"dQw4w9WgXcQ\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{deployment}/api/v1/youtube/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"video_id\": \"dQw4w9WgXcQ\"\n}"
response = http.request(request)
puts response.read_body{
"video_id": "dQw4w9WgXcQ",
"success": true,
"metadata": {
"title": "Rick Astley - Never Gonna Give You Up",
"author_name": "Rick Astley",
"author_url": "https://www.youtube.com/@RickAstleyYT",
"thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"view_count": 1600000000,
"like_count": 17000000
},
"retry_info": {
"total_attempts": 1,
"failed_attempts": 0
}
}{
"video_id": "<string>",
"success": true,
"error": "<string>",
"metadata": {
"title": "<string>",
"author_name": "<string>",
"author_url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_maxres_url": "<string>",
"channel_id": "<string>",
"xml_feed_url": "<string>",
"subscriber_count": "<string>",
"view_count": 123,
"like_count": 123,
"channel_handle": "<string>",
"date_published": "2023-11-07T05:31:56Z",
"upload_date": "2023-11-07T05:31:56Z"
},
"retry_info": {
"total_attempts": 123,
"failed_attempts": 123,
"errors": [
"<string>"
]
}
}{
"video_id": "<string>",
"success": true,
"error": "<string>",
"metadata": {
"title": "<string>",
"author_name": "<string>",
"author_url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_maxres_url": "<string>",
"channel_id": "<string>",
"xml_feed_url": "<string>",
"subscriber_count": "<string>",
"view_count": 123,
"like_count": 123,
"channel_handle": "<string>",
"date_published": "2023-11-07T05:31:56Z",
"upload_date": "2023-11-07T05:31:56Z"
},
"retry_info": {
"total_attempts": 123,
"failed_attempts": 123,
"errors": [
"<string>"
]
}
}{
"video_id": "<string>",
"success": true,
"error": "<string>",
"metadata": {
"title": "<string>",
"author_name": "<string>",
"author_url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_maxres_url": "<string>",
"channel_id": "<string>",
"xml_feed_url": "<string>",
"subscriber_count": "<string>",
"view_count": 123,
"like_count": 123,
"channel_handle": "<string>",
"date_published": "2023-11-07T05:31:56Z",
"upload_date": "2023-11-07T05:31:56Z"
},
"retry_info": {
"total_attempts": 123,
"failed_attempts": 123,
"errors": [
"<string>"
]
}
}Metadata
Get YouTube video metadata
Returns title, author, thumbnails, channel info, and counts for a video. Identify it by either video_url or video_id. Pro license required — a Basic key returns 403 with Pro account required. This route is rate limited.
POST
/
youtube
/
metadata
Get YouTube video metadata
curl --request POST \
--url https://{deployment}/api/v1/youtube/metadata \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"video_id": "dQw4w9WgXcQ"
}
'import requests
url = "https://{deployment}/api/v1/youtube/metadata"
payload = { "video_id": "dQw4w9WgXcQ" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({video_id: 'dQw4w9WgXcQ'})
};
fetch('https://{deployment}/api/v1/youtube/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{deployment}/api/v1/youtube/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'video_id' => 'dQw4w9WgXcQ'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{deployment}/api/v1/youtube/metadata"
payload := strings.NewReader("{\n \"video_id\": \"dQw4w9WgXcQ\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{deployment}/api/v1/youtube/metadata")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"video_id\": \"dQw4w9WgXcQ\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{deployment}/api/v1/youtube/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"video_id\": \"dQw4w9WgXcQ\"\n}"
response = http.request(request)
puts response.read_body{
"video_id": "dQw4w9WgXcQ",
"success": true,
"metadata": {
"title": "Rick Astley - Never Gonna Give You Up",
"author_name": "Rick Astley",
"author_url": "https://www.youtube.com/@RickAstleyYT",
"thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"view_count": 1600000000,
"like_count": 17000000
},
"retry_info": {
"total_attempts": 1,
"failed_attempts": 0
}
}{
"video_id": "<string>",
"success": true,
"error": "<string>",
"metadata": {
"title": "<string>",
"author_name": "<string>",
"author_url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_maxres_url": "<string>",
"channel_id": "<string>",
"xml_feed_url": "<string>",
"subscriber_count": "<string>",
"view_count": 123,
"like_count": 123,
"channel_handle": "<string>",
"date_published": "2023-11-07T05:31:56Z",
"upload_date": "2023-11-07T05:31:56Z"
},
"retry_info": {
"total_attempts": 123,
"failed_attempts": 123,
"errors": [
"<string>"
]
}
}{
"video_id": "<string>",
"success": true,
"error": "<string>",
"metadata": {
"title": "<string>",
"author_name": "<string>",
"author_url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_maxres_url": "<string>",
"channel_id": "<string>",
"xml_feed_url": "<string>",
"subscriber_count": "<string>",
"view_count": 123,
"like_count": 123,
"channel_handle": "<string>",
"date_published": "2023-11-07T05:31:56Z",
"upload_date": "2023-11-07T05:31:56Z"
},
"retry_info": {
"total_attempts": 123,
"failed_attempts": 123,
"errors": [
"<string>"
]
}
}{
"video_id": "<string>",
"success": true,
"error": "<string>",
"metadata": {
"title": "<string>",
"author_name": "<string>",
"author_url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_maxres_url": "<string>",
"channel_id": "<string>",
"xml_feed_url": "<string>",
"subscriber_count": "<string>",
"view_count": 123,
"like_count": 123,
"channel_handle": "<string>",
"date_published": "2023-11-07T05:31:56Z",
"upload_date": "2023-11-07T05:31:56Z"
},
"retry_info": {
"total_attempts": 123,
"failed_attempts": 123,
"errors": [
"<string>"
]
}
}Authorizations
Your deployment's API key (MMK_API_KEY).
Body
application/json
Was this page helpful?
⌘I

