# Youtube - 获取视频评论

所属目录：Youtube

文档地址：https://doc.getoneapi.com/354842769e0

> 此接口已废弃，请优先使用替代接口。

`POST https://api.getoneapi.com/api/youtube/fetch_video_comment`

## 鉴权

在请求头中传递 Authorization: Bearer YOUR_API_KEY（必填）

## 请求参数

### Header 参数

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| Authorization | string | 是 | 在 Header 添加参数 Authorization，其值为在 Bearer 之后拼接 apikey<br><br>默认值： Bearer YOUR_API_KEY |
| Content-Type | string | 是 | 默认值： application/json |

### Body 参数 · application/json

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| video_id | string | 是 | 频道ID<br>例：https://www.youtube.com/watch?v=VdF4cd0SitU 中的 VdF4cd0SitU<br><br>示例值： VdF4cd0SitU |
| max_results | number | 是 | 每页条数<br><br>最小值：1<br>最大值：100 |
| order | enum&lt;string&gt; | 是 | 排序<br><br>枚举值： time 按时间排序<br>relevance 按热门排序 |
| page_token | string | 是 | 下一页参数 |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "video_id" : {
      "type" : "string",
      "title" : "频道ID",
      "description" : "例：https://www.youtube.com/watch?v=VdF4cd0SitU 中的 VdF4cd0SitU",
      "examples" : [ "VdF4cd0SitU" ]
    },
    "max_results" : {
      "type" : "number",
      "minimum" : 1,
      "maximum" : 100,
      "description" : "每页条数"
    },
    "order" : {
      "type" : "string",
      "enum" : [ "time", "relevance" ],
      "description" : "排序",
      "enumNames" : {
        "time" : "按时间排序",
        "relevance" : "按热门排序"
      }
    },
    "page_token" : {
      "type" : "string",
      "description" : "下一页参数\n"
    }
  },
  "required" : [ "video_id", "max_results", "order", "page_token" ]
}
```

#### 示例

```json
{
  "video_id" : "",
  "max_results" : "",
  "order" : "",
  "page_token" : ""
}
```

## 返回响应

### 响应 200 · application/json

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| code | integer | 是 |  |
| message | string | 是 |  |
| data | object | 是 |  |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "code" : {
      "type" : "integer"
    },
    "message" : {
      "type" : "string"
    },
    "data" : {
      "type" : "object",
      "properties" : { }
    }
  },
  "required" : [ "code", "message", "data" ]
}
```

#### 示例

```json
{
  "code" : 200,
  "message" : "success",
  "data" : { }
}
```

## 请求示例代码

```sh
curl --globoff --request POST 'https://api.getoneapi.com/api/youtube/fetch_video_comment' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "video_id" : "",
  "max_results" : "",
  "order" : "",
  "page_token" : ""
}'
```

