YouTube 趋势视频
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 趋势视频
按国家获取 YouTube 某个分类的趋势视频,按名次排列。
POST
/
v1
/
youtube
/
trending-videos
YouTube 趋势视频
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 在某个国家为某个分类维护的趋势页,按名次返回其中的视频。选择新闻、游戏、体育、学习、课程、时尚或购物分类,再给出两位字母的国家代码,每条视频都带名次、标题、频道、播放次数、时长、缩略图,以及发布到现在多久。按固定频率重复查询同一个分类和国家,就能看出哪些视频和频道一直留在榜上,哪些是新冲上来的。{
"category": "news",
"region": "US",
"results_limit": 50
}
标准结果字段
任务结果使用下方稳定的 SocQ 字段。系统会统一来源特有的字段名和格式,但不会推断或补充来源未提供的数据。如需缩小返回字段集合,MCP 查询使用fields,Typed 工具使用 _result_fields,CLI 使用 --result-fields。声明字段的值为 null 时仍会保留。
| 字段 | 类型 | 可空 | 说明 |
|---|---|---|---|
id | string | 是 | YouTube 视频 ID。 |
platform | string | 否 | 结果所属的平台,例如 instagram 或 linkedin。 |
resource | string | 否 | 该结果对应的 SocQ 资源,例如 videos 或 comments。 |
type | string | 否 | 结果项的类别,例如 video、post 或 comment。 |
url | string | 是 | 视频的观看地址。 |
published_at | string | 是 | 视频的发布时间,使用 ISO 8601 格式。趋势页上显示的发布时长见 published_time_text。 |
collected_at | string | 否 | SocQ 采集或处理该结果的时间,使用 ISO 8601 格式。 |
rank | integer | 是 | 视频在趋势页上的名次,从 1 开始。 |
category | string | 是 | 视频所在的趋势分类,例如 news 或 gaming。 |
region | string | 是 | 趋势页所属国家的两位字母代码。 |
title | string | 是 | 视频标题。 |
text | string | 是 | 趋势页上显示的视频简介片段。 |
author | object | 是 | 发布视频的频道。 |
author.id | string | 是 | 作者的唯一标识。 |
author.username | string | 是 | 账号的公开用户名或账号标识。 |
author.name | string | 是 | 作者的显示名称。 |
author.url | string | 是 | 作者的公开访问地址(如可获得)。 |
author.avatar_url | string | 是 | 账号头像图片的地址。 |
author.is_verified | boolean | 是 | 账号是否已通过平台认证。 |
author.is_private | boolean | 是 | 账号是否为私密账号。 |
metrics | object | 是 | 结果项可获得的计数和度量数据。 |
metrics.views_count | integer | 是 | 趋势页上显示的播放次数。 |
duration_seconds | number | 是 | 视频时长,单位为秒。 |
thumbnail_url | string | 是 | 视频缩略图的地址。 |
published_time_text | string | 是 | YouTube 显示的发布时间距今多久,例如 3h ago。 |
任务完成响应
{
"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"
}
]
}
}
}
请求体
application/json
category 必填:news、gaming、sports、learning、courses、fashion 或 shopping。region 为两位字母国家代码,默认 US。按名次返回该分类的趋势视频;results_limit 默认 50,可设 1 到 50。

