# SERP 搜索结果 关键词搜索 API (web.search)

- Canonical page: https://everyinfra.com/web-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "web", "action": "search", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, max 10 per call (larger values are capped)
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=web&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 网页搜索表达式，返回搜索结果标题、链接及摘要，不自动读取结果页全文；不是站内平台名过滤。 |
| country | not declared | no | not declared | 搜索结果的国家/地区偏好，使用国家代码，例如 us；影响结果地域，不是调用服务器所在地，也不保证结果都位于该国。 |
| language | not declared | no | not declared | 搜索界面与结果语言偏好，例如 en 或 zh-cn；不是对返回正文进行翻译的开关。 |
| limit | integer (1–10) | no | not declared | 这次调用最多返回的条数，整数，1–10；不传按默认值，实际返回可能少于这个数。超过上限照收，按上限返回。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| rank | 该结果在搜索结果页中的位次，从 1 开始。 |
| published_at | 页面发布时间，由搜索引擎提取，可能缺失或不准。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| sub_links | platform-native meaning |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "web",
  "action": "search",
  "params": {
    "keyword": "Python documentation"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "web",
        "action": "search",
        "params": {
            "keyword": "Python documentation",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 7. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "web",
  "action": "search",
  "results": [
    {
      "title": "3.14.7 Documentation",
      "url": "https://docs.python.org/",
      "text": "What's new in Python 3.14? Or all \"What's new\" documents since Python 2.0 ; Tutorial Start here: a tour of Python's syntax and features ; Built-ins reference",
      "rank": 1
    },
    {
      "title": "Our Documentation",
      "url": "https://www.python.org/doc/",
      "text": "Browse the docs online or download a copy of your own. Python's documentation, tutorials, and guides are constantly evolving. Get started here,",
      "rank": 2
    }
  ],
  "count": 7,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=web
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
