# Douyin-App/抖音APP - 搜索-多重搜索

所属目录：Douyin-App/抖音APP

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

`POST https://api.getoneapi.com/api/douyin-app/search_multi`

- 获取抖音 App 中多种类型（视频、用户、音乐、话题等）的综合搜索结果。
- 初次请求 cursor 传 0，search_id 传空字符串。
- 返回内容丰富，适合搭建搜索聚合页、推荐页等场景。

## 鉴权

在请求头中传递 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> |
| cursor | string | 是 | 翻页参数<br>首次请求传 0，翻页时使用上次响应的 cursor<br><br>默认值： 0 |
| publish_time | enum&lt;string&gt; | 是 | 发布时间<br>枚举值： 0 不限<br>1 一天内<br>7 七天内<br>180 半年内<br><br>默认值： 0 |
| content_type | enum&lt;string&gt; | 是 | 内容形式<br>枚举值： 0 不限<br>1 视频<br>2 图片<br>3 文章<br><br>默认值： 0 |
| filter_duration | enum&lt;string&gt; | 是 | 视频时长<br>枚举值： 0 不限<br>0-1 一分钟内<br>1-5 1-5分钟<br>5-10000 5分钟以上<br><br>默认值： 0 |
| sort_type | enum&lt;string&gt; | 是 | 排序<br>枚举值： 0 综合排序<br>1 最多点赞<br>2 最新发布<br><br>默认值： 0 |
| search_id | string | 是 | 搜索ID<br>首次请求传空，翻页时从上次响应获取 |
| backtrace | string | 是 | 翻页回溯标识<br>首次请求传空，翻页时从上次响应获取 |

#### JSON Schema

```json
{
  "type" : "object",
  "properties" : {
    "keyword" : {
      "type" : "string",
      "title" : "关键词"
    },
    "cursor" : {
      "type" : "string",
      "description" : "首次请求传 0，翻页时使用上次响应的 cursor",
      "default" : "0",
      "title" : "翻页参数"
    },
    "publish_time" : {
      "type" : "string",
      "title" : "发布时间",
      "enum" : [ "0", "1", "7", "180" ],
      "default" : "0",
      "enumDescriptions" : {
        "0" : "不限",
        "1" : "一天内",
        "7" : "七天内",
        "180" : "半年内"
      }
    },
    "content_type" : {
      "type" : "string",
      "title" : "内容形式",
      "enum" : [ "0", "1", "2", "3" ],
      "default" : "0",
      "enumDescriptions" : {
        "0" : "不限",
        "1" : "视频",
        "2" : "图片",
        "3" : "文章"
      }
    },
    "filter_duration" : {
      "type" : "string",
      "title" : "视频时长",
      "enum" : [ "0", "0-1", "1-5", "5-10000" ],
      "default" : "0",
      "enumDescriptions" : {
        "0" : "不限",
        "0-1" : "一分钟内",
        "1-5" : "1-5分钟",
        "5-10000" : "5分钟以上"
      }
    },
    "sort_type" : {
      "type" : "string",
      "title" : "排序",
      "enum" : [ "0", "1", "2" ],
      "default" : "0",
      "enumDescriptions" : {
        "0" : "综合排序",
        "1" : "最多点赞",
        "2" : "最新发布"
      }
    },
    "search_id" : {
      "type" : "string",
      "description" : "首次请求传空，翻页时从上次响应获取",
      "title" : "搜索ID"
    },
    "backtrace" : {
      "type" : "string",
      "title" : "翻页回溯标识",
      "description" : "首次请求传空，翻页时从上次响应获取"
    }
  },
  "required" : [ "keyword", "publish_time", "content_type", "cursor", "sort_type", "filter_duration", "search_id", "backtrace" ]
}
```

#### 示例

```json
{
  "keyword" : "罗永浩",
  "cursor" : 0,
  "sort_type" : "0",
  "publish_time" : "0",
  "filter_duration" : "0",
  "content_type" : "0",
  "search_id" : "",
  "backtrace" : ""
}
```

## 返回响应

### 响应 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/douyin-app/search_multi' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyword" : "罗永浩",
  "cursor" : 0,
  "sort_type" : "0",
  "publish_time" : "0",
  "filter_duration" : "0",
  "content_type" : "0",
  "search_id" : "",
  "backtrace" : ""
}'
```

