---
title: "Search"
description: "获取一页 Sogou 搜索结果，所有区块按页面顺序返回。"
---

> Every apinoa docs page as markdown: https://apinoa.com/llms.txt (all in one file: https://apinoa.com/llms-full.txt; this API family in one file: https://apinoa.com/docs/serp/llms.txt)

```http
GET | POST /v1/sogou/search
```

参数可以用 `GET` 的查询字符串发送，也可以用 `POST` 的 JSON 请求体发送，两者等价。

## 请求

```bash tab="cURL"
curl -G "https://gateway.apinoa.com/v1/sogou/search" \
  --data-urlencode "q=人工智能" \
  -H "x-api-key: $APINOA_API_KEY"
```

```js tab="JavaScript"
const params = new URLSearchParams({ q: "人工智能" });
const res = await fetch(`https://gateway.apinoa.com/v1/sogou/search?${params}`, {
  headers: { "x-api-key": process.env.APINOA_API_KEY },
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import os

import requests

res = requests.get(
    "https://gateway.apinoa.com/v1/sogou/search",
    params={"q": "人工智能"},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## 参数

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `country` | enum |  | The market, as an ISO 3166 country code. `CN` |
| `cursor` | string |  | The previous page's `cursor`. Pass it alone for the next page. |
| `device` | enum |  | The page each tab is served as, and the only value it takes: mobile for web and news, desktop for images and videos. `desktop` `mobile` |
| `limit` | integer 1–100 |  | Results wanted (default one page: 7-10 on web, 10 news, 48 images; at most 100). More than one page is charged per page. |
| `q` | string |  | The query, search operators included. |
| `timeRange` | enum |  | Only results from this past period. `hour` `day` `week` `month` `year` |
| `type` | enum |  | What to search: web results (default), news, images or videos. `web` `news` `images` `videos` |

The same parameters, and every response type, are in the OpenAPI document: https://apinoa.com/openapi.json

## 响应

在 `data` 中返回 [`ResultsPage`](/docs/api-reference/serp/response-schema#resultspage)。 真实响应的节选：数组只保留前几项，长文本已截断。

```json
{
  "success": true,
  "data": {
    "engine": "sogou",
    "query": "人工智能",
    "type": "web",
    "outcome": "results",
    "country": "CN",
    "device": "mobile",
    "totalResults": 100000000,
    "page": 1,
    "items": [
      {
        "type": "ad",
        "block": "top",
        "url": "https://aistudy.baidu.com/site/wjzsorv8/b361addc-ae0f-4175-9c6c-5549fbbe4be4?q=%E7%BD%91%E…",
        "title": "免费ai大模型有哪些_零成本工具清单，按场景分类查",
        "snippet": "费用与使用门槛提前列明，官网入口可核对，选择前多对比少走弯路更安心",
        "advertiser": "百度知了爱学",
        "displayUrl": "aistudy.baidu.com",
        "ext": {
          "imageLabels": ["测试"],
          "logo": "https://pgdt.gtimg.cn/141/20204/snscosdownload/SZ/reserved/6ad0da310005e2c92977328b19fd011…",
          "button": "查看详情",
          "tags": ["官方"],
          "keywords": ["人工智能ai大模型"],
          "interest": "最近11小时前有人关注此内容",
          "interestCount": 510,
          "sublinks": [{"title": "人工智能制造"}],
          "testimonials": ["服务很周到，让我有更多时间享受生活！"]
        },
        "rank": 1,
        "thumbnail": "https://wxsnsencsvp.wxs.qq.com/141/20204/snscosdownload/SZ/reserved/6xykWLEnztKKZvntY76xvN…"
      },
      {
        "type": "ad",
        "block": "top",
        "url": "https://aistudy.baidu.com/site/wjzsorv8/b361addc-ae0f-4175-9c6c-5549fbbe4be4?q=%E7%B3%BB%E…",
        "title": "人工智能",
        "snippet": "人工智能",
        "advertiser": "百度知了爱学",
        "displayUrl": "aistudy.baidu.com",
        "ext": {
          "imageLabels": ["人工智能,数学"],
          "logo": "https://pgdt.gtimg.cn/141/20204/snscosdownload/SZ/reserved/6ad0da310005e2c92977328b19fd011…",
          "button": "查看详情",
          "tags": ["官方"],
          "keywords": ["人工智能ai系统"],
          "interest": "最近11小时前有人关注此内容",
          "interestCount": 248,
          "testimonials": ["每一次服务都让我感觉物超所值！"],
          "questions": ["AI人工智能软件如何选购?"]
        },
        "rank": 2,
        "thumbnail": "https://wxsnsencsvp.wxs.qq.com/141/20204/snscosdownload/SH/reserved/6xykWLEnztI4eFfyQP9ecv…"
      },
      {
        "type": "knowledgePanel",
        "title": "人工智能 对比",
        "subtitle": "本科 工学学士 四年",
        "facts": [{"label": "开设课程", "value": "高等数学 、 线性代数 、概率和数理统计、 认知心理学 、认知机器人、一门计算机语言（Java/C++/Python 之类)和算法。"}],
        "images": ["https://dlweb.sogoucdn.com/shicivideo/31ecb9d2643db678bf436c586e6a535c1651718648.jpg"],
        "ext": {
          "sections": [
            {
              "title": "开设院校",
              "url": "https://m.sogou.com/openapi/h5/gaokao/major/school?from=vr_zhuanye&major=%E4%BA%BA%E5%B7%A…"
            }
          ],
          "moreUrl": "https://m.sogou.com/openapi/h5/gaokao/major/related?from=vr_zhuanye&major=%E4%BA%BA%E5%B7%…"
        },
        "rank": 4
      },
      {
        "type": "relatedSearches",
        "queries": ["人工智能ai在线观看完整版"],
        "ext": {"placement": "middle"},
        "rank": 5,
        "title": "大家还在搜"
      }
    ],
    "cursor": "yJjoAIqJfHYhsL0toVa2iOz_e0XBPQzb5lV4UBcINkLysJnJGJlz_I2yQ1Z-6K0-c5FcCb0cXSlQPANCA_ipAPUyuy…",
    "fetchedAt": "2026-10-30T00:57:54.651Z"
  }
}
```

## 错误

| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | `INVALID_CURSOR` | 该 `cursor` 不是本操作返回的。请不带它重新开始。 |
| 400 | `INVALID_PARAMS` | 参数缺失、未知、超出范围，或该引擎不接受。消息中会指出是哪一个。 |
| 401 | `UNAUTHORIZED` | 缺少 `x-api-key` 请求头，或密钥已吊销或未知。 |
| 402 | `INSUFFICIENT_BALANCE` | 余额不足以支付本次调用。请在控制台充值。 |
| 429 | `MARKETPLACE_SATURATED` | 并发调用过多。请等待 `Retry-After` 秒后重试。 |
| 502 | `UPSTREAM_ERROR` | 引擎返回了无法使用的内容。请退避后重试。 |
| 503 | `SERVICE_UNAVAILABLE` | 临时故障。请退避后重试。 |

全部错误代码见 [Errors](/docs/errors)。失败的调用不计费。

## 价格

**Price** $0.0012 per call, plus $0.0012 for each extra call it makes — at most 9 more, so $0.012 in total. [List price](https://apinoa.com/en/pricing); the rate steps down above 1,000 calls a day.

## 说明

- `device` 只接受各标签页实际提供的页面：网页和新闻为 `mobile`，图片和视频为 `desktop`。
- `limit` 超过一页时会继续读取后续页面，每页 1 个单位。
