# Tiktok - 搜索视频V2

所属目录：Tiktok

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

`POST https://api.getoneapi.com/api/tiktok/search_video_v2`

## 鉴权

在请求头中传递 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

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| keyword | string | 是 | 关键词<br> |
| offset | integer | 是 | 偏移量<br>默认值： 0 |
| count | integer | 是 | 数量<br>默认值： 20 |
| sort_type | integer | 是 | 0-相关度，1-最多点赞<br><br>默认值： 0 |
| publish_time | integer | 是 | 0-不限制，1-最近一天，7-最近一周，30-最近一个月，90-最近三个月，180-最近半年<br><br>默认值： 0 |
| region | string | 是 | 地区，默认为US-美国，可选值请参考TikTok地区代码或ISO 3166-1 alpha-2国家代码。<br><br>默认值： US |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "keyword" : {
      "type" : "string",
      "title" : "关键词"
    },
    "offset" : {
      "type" : "integer",
      "title" : "偏移量",
      "default" : 0
    },
    "count" : {
      "type" : "integer",
      "title" : "数量",
      "default" : 20
    },
    "sort_type" : {
      "type" : "integer",
      "description" : "0-相关度，1-最多点赞",
      "default" : 0
    },
    "publish_time" : {
      "type" : "integer",
      "description" : "0-不限制，1-最近一天，7-最近一周，30-最近一个月，90-最近三个月，180-最近半年",
      "default" : 0
    },
    "region" : {
      "type" : "string",
      "description" : "地区，默认为US-美国，可选值请参考TikTok地区代码或ISO 3166-1 alpha-2国家代码。",
      "default" : "US"
    }
  },
  "required" : [ "keyword", "offset", "count", "sort_type", "publish_time", "region" ]
}
```

#### 示例

```json
{
  "keyword" : "罗永浩",
  "offset" : 0,
  "count" : 20,
  "sort_type" : 0,
  "publish_time" : 0,
  "region" : "US"
}
```

## 返回响应

### 响应 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/tiktok/search_video_v2' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyword" : "罗永浩",
  "offset" : 0,
  "count" : 20,
  "sort_type" : 0,
  "publish_time" : 0,
  "region" : "US"
}'
```

