跳转到主要内容
GET
Get YouTube channel insights

请求规范

  • 方法与路径: GET /apis/v1/social/analytics/youtube/channel-insights
  • 可用状态: enabled
  • 请求 URL 模板: https://api.aisa.one/apis/v1/social/analytics/youtube/channel-insights
  • accountId: query; 必填
  • metrics: query; 可选
  • fromDate: query; 可选
  • toDate: query; 可选
  • since: query; 可选
  • until: query; 可选
  • metricType: query; 可选
  • Runtime 事实版本: 99acb5bddbedc8d3352e7c4fef86c3e6d8852c14772bcd18dbcf415237a642bd
完整 OpenAPI 定义 有效请求与价格声明(包括认证和引用的 schema):

费用与请求规则

当前未提供请求参考价格;请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。 公开参考值不是你的账户报价或最终扣费。对于支持 X-AISA-Cost-Mode: quote 的接口,执行前请针对完整请求获取免费报价;执行后通过响应费用元数据和 Usage Logs 核对结算费用。1 USD 等于 1,000,000 个整数 micro-USD。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

查询参数

accountId
string
必填

One of your social accounts (acc_...).

Pattern: ^acc_[0-9A-Za-z]{22}$
metrics
string

Comma-separated list. Defaults to "views,estimatedMinutesWatched,subscribersGained,subscribersLost".

Live YouTube Analytics v2 metrics:

  • views
  • estimatedMinutesWatched
  • averageViewDuration (ratio - weighted mean computed across days)
  • subscribersGained
  • subscribersLost

AIsa-synthesized from daily follower snapshots (cross-platform parity):

  • followers_gained
  • followers_lost
fromDate
string<date>

Start date (YYYY-MM-DD). Defaults to 30 days ago.

toDate
string<date>

End date (YYYY-MM-DD). Defaults to today. YouTube Analytics has a 2-3 day delay, so the fetch is internally clamped to 3 days ago; any requested range extending beyond that returns zero values for the tail days. The response's dateRange.until field reflects your requested value.

since
string<date>

Alias of fromDate, kept for existing callers

until
string<date>

Alias of toDate, kept for existing callers

metricType
enum<string>
默认值:total_value

"total_value" (default) returns aggregated totals. "time_series" returns per-day values in the "values" array.

可用选项:
time_series,
total_value

响应

Channel insights data

Shared account-insights response envelope used by every platform-level analytics endpoint (/apis/v1/social/analytics/{facebook|instagram|youtube|linkedin|tiktok}/*). The name is historical - the shape was first shipped for Instagram and every new platform endpoint reuses it for response-shape consistency. The platform field echoes back which platform served the response.

accountId
string

One of your social accounts (acc_...).

Pattern: ^acc_[0-9A-Za-z]{22}$
breakdown
string

Breakdown dimension used (only present when breakdown was requested)

dataDelay
string
dateRange
object
metricType
enum<string>
可用选项:
time_series,
total_value
metrics
object

Object keyed by metric name.

  • For time_series: each metric has "total" (number) and "values" (array of {date, value}).
  • For total_value: each metric has "total" (number) and optionally "breakdowns" (array of {dimension, value}).

Monetary metrics also carry "unit" and "currency". AIsa never rescales money: "total" and every "values[].value" are the platform's raw numbers in the stated unit.

Monetary metrics keep "values" even on metricType=total_value, because their "total" is the sum of the daily buckets the platform returned over the range. Keep the series to reconcile that sum against the platform's own reporting before invoicing on it.

A metric that could not be served is absent from this object and listed in "unavailableMetrics" instead, so an unavailable metric is never reported as a zero.

platform
enum<string>

Platform that served this response.

可用选项:
facebook,
instagram,
youtube,
linkedin,
tiktok
success
boolean
unavailableMetrics
object[]

Requested metrics that could not be served. Present only when at least one metric is unavailable, absent otherwise.

Each listed metric is OMITTED from "metrics" rather than reported as 0, which is how an unavailable metric is distinguished from a genuine zero. The request itself still succeeds with HTTP 200.