# 实时 YouTube 视频信息高级版

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/serp/youtube/video_info/live/advanced`

**Tags:** DataForSEO

同步返回某个 YouTube 视频在 YouTube 上的元数据。返回 `keyword`、`type`、`se_domain`、`location_code`、`language_code`、`check_url`、`datetime`、`spell`、`refinement_chips`、`item_types`、`items_count` 和 `items`。默认选择 `advanced`；如果只关心排名列表，就用 `regular`；只有想检查解析器丢弃了什么时才用 `html`。采用 DataForSEO 的信封结构：数据位于 `tasks[0].result`，结果状态位于 `tasks[0].status_code`——被拒绝的请求仍会返回 HTTP 200。

### 计费参考

- 计量方式：按上报的响应成本计量。
- 参考请求估算：0.006 美元。
- 参考客户倍率：1.0。不得对已结算的客户金额再次应用。

仅供参考的元数据，不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "video_id": {
            "type": "string",
            "description": "视频 ID\n必填字段\n可在 URL 或 YouTube Organic 结果的 'youtube_video' 项中找到视频 ID\n示例：\nvQXvyV0zIP4"
          },
          "location_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "搜索引擎地点代码\n未指定 location_name 时为必填字段\n如果使用此字段，则无需指定 location_name\n可单独向 https://api.dataforseo.com/v3/serp/youtube/locations 发起请求，获取搜索引擎支持的地点及其 location_code 列表\n示例：\n2840"
          },
          "language_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "搜索引擎语言代码\n未指定 language_name 时为必填字段\n如果使用此字段，则无需指定 language_name\n可单独向 https://api.dataforseo.com/v3/serp/youtube/languages 发起请求，获取搜索引擎支持的语言及其 language_code 列表\n示例：\nen"
          },
          "device": {
            "type": [
              "string",
              "null"
            ],
            "description": "设备类型\n可选字段\n唯一值：desktop"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "搜索引擎地点全名\n未指定 location_code 时为必填字段\n如果使用此字段，则无需指定 location_code\n可单独向 https://api.dataforseo.com/v3/serp/youtube/locations 发起请求，获取搜索引擎支持的地点及其 location_name 列表\n示例：\nUnited States"
          },
          "language_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "搜索引擎语言全名\n未指定 language_code 时为必填字段\n如果使用此字段，则无需指定 language_code\n可单独向 https://api.dataforseo.com/v3/serp/youtube/languages 发起请求，获取搜索引擎支持的语言及其 language_name 列表\n示例：\nEnglish"
          },
          "os": {
            "type": [
              "string",
              "null"
            ],
            "description": "设备操作系统\n可选字段\n请从以下值中选择：windows、macos\n默认值：windows"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "用户自定义任务标识符\n可选字段\n字符数上限为 255\n可使用此参数标识任务，并将其与结果对应\n可在响应的 data 对象中找到指定的 tag 值"
          }
        },
        "example": [
          {
            "language_code": "en",
            "location_code": 2840,
            "video_id": "vQXvyV0zIP4"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "language_code": "en",
      "location_code": 2840,
      "video_id": "vQXvyV0zIP4"
    }
  ]
}
```

## Responses

### 200 — 操作成功

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedResponseInfo"
    }
  ]
}
```

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API 的当前版本"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "通用状态码\n完整响应码列表见此处"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "通用信息性消息\n完整的一般信息性消息列表见此处"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "总执行时间，秒"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "任务总费用，美元",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 数组中的任务数",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 数组中返回错误的任务数",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "任务标识符\n我们系统中 UUID 格式的唯一任务标识符"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "任务的状态码\n由 DataForSEO 生成，范围如下：10000-60000\n完整响应码列表见此处"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "任务的信息性消息\n完整的一般信息性消息列表见此处"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "执行时间，秒"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "任务总费用，美元",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result 数组中的元素数",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL 路径"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "包含你在 POST 请求中指定的相同参数"
    }
  }
}
```

### Response36Afe1097B20_ChannelSubscribersCount

`#/components/schemas/Response36Afe1097B20_ChannelSubscribersCount`

```json
{
  "type": "object",
  "properties": {
    "displayed_count": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>显示的订阅者数</em><br>            YouTube 上显示的订阅者数"
    },
    "count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>订阅者数</em>",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedResponseInfo

`#/components/schemas/Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedTaskInfo"
              }
            ]
          },
          "description": "任务数组"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedResultInfo

`#/components/schemas/Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedResultInfo`

```json
{
  "type": "object",
  "properties": {
    "video_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "POST 数组中收到的视频 ID"
    },
    "se_domain": {
      "type": [
        "string",
        "null"
      ],
      "description": "POST 数组中的搜索引擎域名"
    },
    "location_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "POST 数组中的地点代码"
    },
    "language_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "POST 数组中的语言代码"
    },
    "check_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "搜索引擎结果的直接 URL\n你可以用它确认我们提供的结果准确无误"
    },
    "datetime": {
      "type": [
        "string",
        "null"
      ],
      "description": "收到结果时的日期和时间\n采用 UTC 格式：“yyyy-mm-dd hh-mm-ss +00:00”\n示例：\n2019-11-15 12:57:46 +00:00"
    },
    "spell": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_SpellInfo"
        }
      ],
      "description": "搜索引擎的自动更正\n如果搜索引擎返回的是更正后关键词的结果，我们会注明搜索引擎更正的关键词以及自动更正的类型"
    },
    "item_types": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "SERP 中的搜索结果类型\n包含在 SERP 中找到的搜索结果类型（items）。\n可能的条目：\nyoutube_video_info"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "items 数组中返回的结果数",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_YoutubeVideoInfo"
          }
        ]
      },
      "description": "在 SERP 中找到的搜索结果元素"
    }
  }
}
```

### Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedTaskInfo

`#/components/schemas/Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_SerpYoutubeVideoInfoLiveAdvancedResultInfo"
              }
            ]
          },
          "description": "结果数组"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_SpellInfo

`#/components/schemas/Response36Afe1097B20_SpellInfo`

```json
{
  "properties": {
    "keyword": {
      "type": [
        "string",
        "null"
      ],
      "description": "搜索引擎自动更正后得到的关键词\n 将为更正后的关键词提供结果"
    },
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "自动更正的类型\n 可能的值：\n did_you_mean、showing_results_for、no_results_found_for、including_results_for\n 注意：Yahoo 和 Yandex 仅支持以下自动更正类型：\n including_results_for"
    }
  }
}
```

### Response36Afe1097B20_StreamingQualityElement

`#/components/schemas/Response36Afe1097B20_StreamingQualityElement`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "元素类型"
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>质量元素的标签</em>"
    },
    "width": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频宽度（像素）</em>",
      "format": "int64"
    },
    "height": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频高度（像素）</em>"
    },
    "bitrate": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频的<a href=\"https://en.wikipedia.org/wiki/Bit_rate\" target=\"_blank\" rel=\"noopener noreferrer\">比特率</a></em>"
    },
    "mime_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频的<a href=\"https://en.wikipedia.org/wiki/Media_type\" target=\"_blank\" rel=\"noopener noreferrer\">媒体类型</a></em>"
    },
    "fps": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频的<a href=\"https://en.wikipedia.org/wiki/Frame_rate\" target=\"_blank\" rel=\"noopener noreferrer\">帧率</a></em>"
    }
  }
}
```

### Response36Afe1097B20_Subtitles

`#/components/schemas/Response36Afe1097B20_Subtitles`

```json
{
  "type": "object",
  "properties": {
    "language": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>字幕语言</em>"
    },
    "is_translatable": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>定义字幕是否可翻译</em>"
    },
    "is_auto_generated": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>定义字幕是否为自动生成</em>"
    }
  }
}
```

### Response36Afe1097B20_YoutubeVideoInfo

`#/components/schemas/Response36Afe1097B20_YoutubeVideoInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "元素类型"
    },
    "rank_group": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>SERP 中的组排名</em><br>            在 <code>type</code> 值相同的元素组内的位置<br>            <code>type</code> 值不同的元素位置不会计入 <code>rank_group</code>"
    },
    "rank_absolute": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em> 目标域名在 SERP 中的绝对排名</em><br>            SERP 中所有元素中的绝对位置"
    },
    "video_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>POST 数组中收到的视频 ID</em>"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频标题</em>"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频的 URL</em>"
    },
    "thumbnail_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>缩略图所在页面的 URL</em>"
    },
    "channel_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频发布所在频道的 ID</em>"
    },
    "channel_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频发布所在频道的名称</em>"
    },
    "channel_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频发布所在频道的 URL</em>"
    },
    "channel_logo": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>频道徽标图片所在页面的 URL</em>"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频描述</em>"
    },
    "views_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频的观看次数</em>",
      "format": "int64"
    },
    "likes_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频的点赞数</em>",
      "format": "int64"
    },
    "comments_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频的评论数</em>",
      "format": "int64"
    },
    "channel_subscribers_count": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_ChannelSubscribersCount"
        }
      ],
      "description": "<em>频道订阅者数量</em>"
    },
    "publication_date": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频发布的日期</em>"
    },
    "timestamp": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>结果发布时的日期和时间</em><br>            采用 UTC 格式：“yyyy-mm-dd hh-mm-ss +00:00”<br>            示例：<br>            <code>2022-11-15 12:57:46 +00:00</code>"
    },
    "keywords": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "<em>与视频相关的关键词</em><br>            也称为“YouTube 标签”"
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频所属类别</em>"
    },
    "is_live": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>指示视频是否为直播</em>"
    },
    "is_embeddable": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>指示视频是否可嵌入</em>"
    },
    "duration_time": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>视频时长</em>"
    },
    "duration_time_seconds": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>视频时长（秒）</em>"
    },
    "subtitles": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_Subtitles"
          }
        ]
      },
      "description": "<em>描述视频字幕属性的元素数组</em>"
    },
    "streaming_quality": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_StreamingQualityElement"
          }
        ]
      },
      "description": "<em>包含视频所有可能流式传输画质信息的元素数组</em>"
    }
  }
}
```
