YouTube Trending Videos API
curl --request POST \
--url https://api.socq.ai/v1/youtube/trending-videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "<string>",
"region": "US",
"results_limit": 50
}
'import requests
url = "https://api.socq.ai/v1/youtube/trending-videos"
payload = {
"callback_url": "<string>",
"region": "US",
"results_limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({callback_url: '<string>', region: 'US', results_limit: 50})
};
fetch('https://api.socq.ai/v1/youtube/trending-videos', 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://api.socq.ai/v1/youtube/trending-videos",
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([
'callback_url' => '<string>',
'region' => 'US',
'results_limit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.socq.ai/v1/youtube/trending-videos"
payload := strings.NewReader("{\n \"callback_url\": \"<string>\",\n \"region\": \"US\",\n \"results_limit\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.socq.ai/v1/youtube/trending-videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"<string>\",\n \"region\": \"US\",\n \"results_limit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.socq.ai/v1/youtube/trending-videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"<string>\",\n \"region\": \"US\",\n \"results_limit\": 50\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "<string>",
"status": "<string>",
"created_time": "<string>"
}
}{
"code": 422,
"error": {
"message": "<string>",
"type": "<string>",
"details": {}
}
}YouTube
YouTube Trending Videos
Collect the videos trending in a YouTube category for a country, in rank order.
POST
/
v1
/
youtube
/
trending-videos
YouTube Trending Videos API
curl --request POST \
--url https://api.socq.ai/v1/youtube/trending-videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "<string>",
"region": "US",
"results_limit": 50
}
'import requests
url = "https://api.socq.ai/v1/youtube/trending-videos"
payload = {
"callback_url": "<string>",
"region": "US",
"results_limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({callback_url: '<string>', region: 'US', results_limit: 50})
};
fetch('https://api.socq.ai/v1/youtube/trending-videos', 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://api.socq.ai/v1/youtube/trending-videos",
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([
'callback_url' => '<string>',
'region' => 'US',
'results_limit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.socq.ai/v1/youtube/trending-videos"
payload := strings.NewReader("{\n \"callback_url\": \"<string>\",\n \"region\": \"US\",\n \"results_limit\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.socq.ai/v1/youtube/trending-videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"<string>\",\n \"region\": \"US\",\n \"results_limit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.socq.ai/v1/youtube/trending-videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"<string>\",\n \"region\": \"US\",\n \"results_limit\": 50\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "<string>",
"status": "<string>",
"created_time": "<string>"
}
}{
"code": 422,
"error": {
"message": "<string>",
"type": "<string>",
"details": {}
}
}YouTube Trending Videos
Read the trending page YouTube keeps for a category in a given country and get its videos in rank order. Pick news, gaming, sports, learning, courses, fashion or shopping and a two-letter country code; each video comes back with its rank, title, channel, view count, length, thumbnail and how long ago it was posted. Run the same category and country on a schedule to see which videos and channels hold their place and which ones climb in.{
"category": "news",
"region": "US",
"results_limit": 50
}
Standard Result Fields
Task results use the stable SocQ fields below. Source-specific field names and formats are normalized without inferring or enriching values that the source did not provide. To request a smaller field set, usefields for MCP queries, _result_fields for typed tools, or --result-fields in the CLI. Declared fields remain present when their value is null.
| Field | Type | Nullable | Description |
|---|---|---|---|
id | string | Yes | YouTube video ID. |
platform | string | No | Platform the result belongs to, such as instagram or linkedin. |
resource | string | No | SocQ resource represented by the result, such as videos or comments. |
type | string | No | Category of the result item, such as video, post, or comment. |
url | string | Yes | Watch URL of the video. |
published_at | string | Yes | Time the video was published, in ISO 8601 format. The age YouTube shows on the trending page is in published_time_text. |
collected_at | string | No | Time SocQ collected or processed this result, in ISO 8601 format. |
rank | integer | Yes | Position of the video on the trending page, starting at 1. |
category | string | Yes | Trending category the video was listed in, such as news or gaming. |
region | string | Yes | Two-letter country code of the trending page. |
title | string | Yes | Title of the video. |
text | string | Yes | Description snippet shown on the trending page. |
author | object | Yes | Channel that published the video. |
author.id | string | Yes | Unique identifier of the author. |
author.username | string | Yes | Public username or handle of the account. |
author.name | string | Yes | Display name of the author. |
author.url | string | Yes | Public URL of the author when available. |
author.avatar_url | string | Yes | URL of the account avatar image. |
author.is_verified | boolean | Yes | Whether the account is verified on the platform. |
author.is_private | boolean | Yes | Whether the account is private. |
metrics | object | Yes | Counters and measurements available for the result item. |
metrics.views_count | integer | Yes | View count shown on the trending page. |
duration_seconds | number | Yes | Length of the video in seconds. |
thumbnail_url | string | Yes | URL of the video thumbnail. |
published_time_text | string | Yes | How long ago the video was published, as YouTube shows it, such as 3h ago. |
Completed Task Response
{
"code": 200,
"data": {
"task_id": "example-youtube-trending-videos",
"status": "succeeded",
"public_id": "youtube/trending-videos",
"result_count": 2,
"credits_amount": 1,
"results": {
"limit": 50,
"next_cursor": null,
"has_more": false,
"schema_id": "trending-video",
"schema_version": "1.0",
"items": [
{
"id": "X92BwhZZKOU",
"platform": "youtube",
"resource": "trending-videos",
"type": "video",
"url": "https://www.youtube.com/watch?v=X92BwhZZKOU",
"published_at": null,
"collected_at": "2026-11-20T08:10:17Z",
"rank": 1,
"category": "news",
"region": "US",
"title": "Historic or just a photo op? Reading Trump's Xi-Putin summit",
"text": "US President Donald Trump hailed his unprecedented three-way summit with Chinese President Xi Jinping and Russian President Vladimir Putin as a success.",
"author": {
"id": "UChqUTb7kYRX8-EiaN3XFrSQ",
"username": "Reuters",
"name": "Reuters",
"url": "https://www.youtube.com/@Reuters",
"avatar_url": "https://example.com/reuters-avatar.jpg",
"is_verified": true,
"is_private": null
},
"metrics": {
"views_count": 387
},
"duration_seconds": 177,
"thumbnail_url": "https://i.ytimg.com/vi/X92BwhZZKOU/hqdefault.jpg",
"published_time_text": "15 min ago"
},
{
"id": "FKBYgR7fz0I",
"platform": "youtube",
"resource": "trending-videos",
"type": "video",
"url": "https://www.youtube.com/watch?v=FKBYgR7fz0I",
"published_at": null,
"collected_at": "2026-11-20T08:10:17Z",
"rank": 2,
"category": "news",
"region": "US",
"title": "Trump put Xi Jinping in HIS PLACE, expert says",
"text": "Fox News co-host Charlie Hurt and author Gordon Chang discuss President Donald Trump's trilateral meeting with Xi Jinping and Vladimir Putin in China on 'Hannity.'",
"author": {
"id": "UCXIJgqnII2ZOINSWNOGFThA",
"username": "FoxNews",
"name": "Fox News",
"url": "https://www.youtube.com/@FoxNews",
"avatar_url": "https://example.com/foxnews-avatar.jpg",
"is_verified": true,
"is_private": null
},
"metrics": {
"views_count": 4987
},
"duration_seconds": 496,
"thumbnail_url": "https://i.ytimg.com/vi/FKBYgR7fz0I/hqdefault.jpg",
"published_time_text": "1 hr ago"
}
]
}
}
}
Authorizations
bearerAuthapiKeyAuth
Body
application/json
category is required: news, gaming, sports, learning, courses, fashion or shopping. region is a two-letter country code and defaults to US. Returns the category's trending videos in rank order; results_limit defaults to 50 and accepts 1 to 50.

