# 通过关键词搜索 GPTs V2

**方法**: `GET`
**路径**: `/v2/gpts/search`

关键词搜索 gpts ，返回 json 数组

## 请求参数

### Query 参数

```text
query
string
搜索的关键词
可选
示例:
代码大师
```

### Header 参数

```text
Content-Type
string
可选
示例:
application/json
Accept
string
可选
示例:
application/json
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}
```

## 请求示例代码

### Shell

```bash
curl --location --request GET '/v2/gpts/search?query=代码大师' \
--header 'Accept:  application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type:  application/json'
```

## 返回响应

### 🟢 200 成功

**内容类型**: `application/json`

#### 响应结构

```text
object
```

#### 示例

```json
{
    "code": 0,
    "msg": "ok",
    "sn": "3ebe36446a471e0354d8a89b231b78f2",
    "data": [
        {
            "id": "g-wT55KtZzB",
            "title": "代码解释器 - OpenAI",
            "link": "https://chat.openai.com/g/g-wT55KtZzB-dai-ma-jie-shi-qi",
            "description": "代码解释器. By community builder. Sign up to chat. Requires ChatGPT Plus. ChatGPT is a free-to-use AI system. Use it for engaging conversations, gain insights, automate tasks, and witness the future of AI, all in one place.",
            "favicon": "https://external-content.duckduckgo.com/ip3/chat.openai.com.ico"
        },
        {
            "id": "g-70zW3LbwV",
            "title": "Python代码助手 - OpenAI",
            "link": "https://chat.openai.com/g/g-70zW3LbwV-pythondai-ma-zhu-shou",
            "description": "你好，我是你的Python代码助手。我可以帮助你编写和优化Python代码，解决你在编程过程中遇到的问题。你可以向我询问任何关于Python编程的问题，我会尽我最大的努力为你提供清晰、简洁的答案和解决方案。如果你有任何代码需要我帮助你编写或优化，只需告诉我你的需求和目标，我会为你生成符合 ...",
            "favicon": "https://external-content.duckduckgo.com/ip3/chat.openai.com.ico"
        }
    ]
}
```
