---
title: "SERP API"
description: "Google、Bing、Naver、百度、Yandex 等 16 个搜索引擎，以及地图、应用商店和 Google Trends，通过一套操作和一个结构提供。"
---

> 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)

SERP API 按人看到的样子读取搜索引擎。结果页按显示顺序返回：自然结果、广告、新闻、图片、视频、"相关问题"、知识面板、
本地结果和 AI 概览。所有引擎共用一个结构，读取 Google 的代码同样能读取 Naver。

```bash
curl "https://gateway.apinoa.com/v1/google/search?q=best+running+shoes&country=US" -H "x-api-key: $APINOA_API_KEY"
curl "https://gateway.apinoa.com/v1/naver/places?q=강남역+카페" -H "x-api-key: $APINOA_API_KEY"
curl "https://gateway.apinoa.com/v1/google-trends/explore?terms=chatgpt,gemini&country=US" -H "x-api-key: $APINOA_API_KEY"
```

## 操作

| 操作 | 返回 | 读取内容 |
|---|---|---|
| `search` | `ResultsPage` | 一页结果：用 `type` 选择网页（默认）、`news`、`images` 或 `videos`。部分引擎还接受 `type=image` 加 `image` URL 进行以图搜图 |
| `suggestions` | `Suggestions` | 搜索框针对 `q` 给出的联想词 |
| `places` | `PlacesPage` | 用 `q` 在地图上找到的地点，范围是 `near`（地名）或 `location`（`lat,lng`）附近 |
| `place` | `Place` | 单个地点：`places` 返回的 `id`，或其地图链接 `url` |
| `reviews` | `PlaceReviewsPage` | 地点的评论：`place` |

应用商店和 Google Trends 使用相同的命名：应用为 `search`、`app` 和 `reviews`，Trends 为 `explore` 和 `trending`。

## 各引擎支持哪些

| | search | suggestions | places | place | reviews | 市场 |
|---|:-:|:-:|:-:|:-:|:-:|---|
| [Google](/docs/api-reference/google) | ✓ | ✓ | ✓ | ✓ | | 10 |
| [Bing](/docs/api-reference/bing) | ✓ | ✓ | | | | 10 |
| [Yahoo](/docs/api-reference/yahoo) | ✓ | ✓ | | | | 13 |
| [DuckDuckGo](/docs/api-reference/duckduckgo) | ✓ | ✓ | | | | 14 |
| [Yandex](/docs/api-reference/yandex) | ✓ | ✓ | ✓ | ✓ | ✓ | 10 |
| [Naver](/docs/api-reference/naver) | ✓ | ✓ | ✓ | ✓ | ✓ | KR |
| [Daum](/docs/api-reference/daum) | ✓ | ✓ | | | | KR |
| [Baidu](/docs/api-reference/baidu) | ✓ | ✓ | | | | CN |
| [Sogou](/docs/api-reference/sogou) | ✓ | ✓ | | | | CN |
| [Yahoo! JAPAN](/docs/api-reference/yahoo-japan) | ✓ | ✓ | | | | JP |
| [Seznam](/docs/api-reference/seznam) | ✓ | ✓ | | | | CZ |
| [Tripadvisor](/docs/api-reference/tripadvisor) | | | ✓ | ✓ | ✓ | 15 |

| | 操作 |
|---|---|
| [Google Shopping](/docs/api-reference/google-shopping) | `search` `product` `reviews`，返回电商平台类型 |
| [Google Play](/docs/api-reference/google-play) · [App Store](/docs/api-reference/app-store) | `search` `app` `reviews` |
| [Google Trends](/docs/api-reference/google-trends) | `explore` `trending` |

各引擎的页面列出了每个操作在那里接受的输入。

## 输入

同一个名称在所有引擎上含义相同：

| 输入 | 含义 |
|---|---|
| `q` | 查询，可包含搜索运算符 |
| `type` | 搜索什么：`web`、`news`、`images`、`videos`（各引擎接受其中一部分） |
| `country` | 市场，ISO 3166 国家代码 |
| `lang` | 界面语言（`en`、`pt-BR`） |
| `device` | 读取 `desktop` 页面（默认）或 `mobile` 页面 |
| `timeRange` | 只要过去 `hour`、`day`、`week`、`month` 或 `year` 内的结果 |
| `safe` | 安全搜索，`on` 或 `off` |
| `near` · `location` | 用于 `places`：地名或 `lat,lng` 坐标 |
| `id` · `place` | 要读取的地点（或应用）；`id` 也可以用链接 `url` 代替 |
| `sort` | 评论排序 |
| `limit` | 想要的结果数。超过一页时按页计费 |
| `cursor` | 下一页 |

引擎不接受的输入会以 `400 INVALID_PARAMS` 拒绝，而不是被忽略。没有按你的要求完成的页面不会收费。

## 处处相同的部分

- **结构。** 每个操作都返回 [Response Schema](/docs/api-reference/serp/response-schema) 中的某个类型。只有某个引擎才有的信息放在 `ext` 中。
- **不丢弃任何内容。** 页面上的每个区块都按页面顺序连同 `rank` 返回。尚无共享结构的区块以 `type: "other"` 返回。
- **分页。** 列表会返回一个不透明的 `cursor`。要取下一页，只带 `cursor` 调用同一个操作。没有 `cursor` 表示没有下一页。
- **缺失不等于零。** 页面没有显示的数量或评分会直接省略，绝不报告为 `0`。时间为 ISO 8601、UTC。
- **没有结果也是一种回答。** `outcome: "noResults"` 表示引擎说它什么也没找到。无法读取的页面是错误，错误不计费。
- **价格。** 每单位 $0.0012。大多数调用为 1 个单位。`limit` 超过一页时每页 1 个单位，每个操作的页面列出了其价格范围。

## 错误

SERP API 使用与 API 其他部分相同的响应格式和代码，见 [Errors](/docs/errors)。不存在的地点或应用返回 `404 NOT_FOUND`，不存在的商品返回 `404 PRODUCT_NOT_FOUND`，消息中会给出该 id。单个商店的 Google Shopping 商品没有评论，返回 `404 REVIEWS_NOT_FOUND`。

## 参考

- [Response Schema](/docs/api-reference/serp/response-schema)：每个类型的每个字段
- [AI Answers API](/docs/api-reference/answers)：ChatGPT、Gemini、Google AI Mode 等，统一为一种回答类型
- [Errors](/docs/errors)：所有错误代码
