curl --request GET \
--url https://api.aisa.one/apis/v1/social/analytics/youtube/demographics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/analytics/youtube/demographics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/analytics/youtube/demographics', 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.aisa.one/apis/v1/social/analytics/youtube/demographics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/analytics/youtube/demographics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/social/analytics/youtube/demographics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/analytics/youtube/demographics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"accountId": "<string>",
"dateRange": {
"endDate": "<string>",
"startDate": "<string>"
},
"demographics": {},
"note": "<string>",
"platform": "<string>",
"provisionalSince": "2023-12-25",
"publishedAt": "2023-11-07T05:31:56Z",
"success": true,
"title": "<string>",
"videoId": "<string>"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}Get YouTube demographics
Analytics. Read only; needs social:read. Ids are yours: accounts acc_…, profiles prf_…, posts pst_…; every other object id is checked against your accounts before the call. Charged only when the call succeeds. Repeated identical requests within 6 hours are served from cache at no charge (response header X-AISA-Cache: hit, with Age in seconds); send Cache-Control: no-cache to force a fresh read, which is charged.
Returns audience demographic insights for a YouTube channel, broken down by age, gender, and/or country. Pass videoId to get the audience profile of a single video instead of the whole channel.
- Age and gender values are viewer percentages (0-100).
- Country values are view counts.
Data is based on signed-in viewers only, with a 2-3 day delay. YouTube suppresses demographics for videos with too few signed-in views, so low-traffic videos can return empty breakdowns.
curl --request GET \
--url https://api.aisa.one/apis/v1/social/analytics/youtube/demographics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/analytics/youtube/demographics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/analytics/youtube/demographics', 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.aisa.one/apis/v1/social/analytics/youtube/demographics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/analytics/youtube/demographics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/social/analytics/youtube/demographics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/analytics/youtube/demographics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"accountId": "<string>",
"dateRange": {
"endDate": "<string>",
"startDate": "<string>"
},
"demographics": {},
"note": "<string>",
"platform": "<string>",
"provisionalSince": "2023-12-25",
"publishedAt": "2023-11-07T05:31:56Z",
"success": true,
"title": "<string>",
"videoId": "<string>"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}请求规范
- 方法与路径: GET /apis/v1/social/analytics/youtube/demographics
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/social/analytics/youtube/demographics - accountId: query; 必填
- videoId: query; 可选
- breakdown: query; 可选
- fromDate: query; 可选
- toDate: query; 可选
- startDate: query; 可选
- endDate: query; 可选
{
"operationId": "get_aisa_social_apis_v1_social_analytics_youtube__2c7672",
"method": "GET",
"path": "/apis/v1/social/analytics/youtube/demographics",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "One of your social accounts (acc_...).",
"in": "query",
"name": "accountId",
"required": true,
"schema": {
"pattern": "^acc_[0-9A-Za-z]{22}$",
"type": "string"
}
},
{
"description": "YouTube video ID. When provided, demographics are scoped to this single video\n(must belong to the connected channel; otherwise 404 video_not_found).",
"in": "query",
"name": "videoId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated list of demographic dimensions: age, gender, country.\nDefaults to all three if omitted.",
"in": "query",
"name": "breakdown",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Start date in YYYY-MM-DD format. Defaults to 90 days ago, or to the video's\npublish date (lifetime) when videoId is provided.",
"in": "query",
"name": "fromDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day\n(YouTube finalizes analytics with a ~3-day delay). An explicit toDate is honored\nup to today: days inside the delay window are provisional and may still be revised\nby YouTube (see provisionalSince in the response).",
"in": "query",
"name": "toDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "Alias of fromDate, kept for existing callers",
"in": "query",
"name": "startDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "Alias of toDate, kept for existing callers",
"in": "query",
"name": "endDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
公开参考价格:每次成功请求 $0.001 USD。 失败或结果未知时不收费。 6 小时内的相同请求命中缓存时免费。 强制刷新按次收费。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
查询参数
End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit toDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response).
响应
Demographic insights data