# Bing 搜索 关键词搜索 API (bing.search)

- Canonical page: https://everyinfra.com/bing-api/search
- Endpoint: POST /api/v1/social with {"platform": "bing", "action": "search", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed and empty results are not charged
- Returns: list
- 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=bing&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | Bing 搜索词，支持引号短语、减号排除等 Bing 语法，最多 2048 字；每次返回第一页（约 10 条）网页结果，不能翻页。 |
| country | not declared | no | not declared | 按哪个国家搜，两位国家代码（如 us、de、jp）；不填按默认地区。不是结果网站所在国家的过滤。 |
| language | not declared | no | not declared | 结果语言，两位语言代码（如 en、es、ja），和 country 一起给才生效（按「语言-国家」市场搜）。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 该结果在这一页搜索结果里的名次，从 1 开始（翻页后接着上一页往下数）。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| url | 该记录在原平台上的可访问链接。 |
| displayed_url | 结果下方显示的网址（搜索引擎的显示写法，可能带 › 分隔），不一定能直接打开；要打开用 url。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| date_text | 摘要前显示的日期原文（如 Oct 24, 2026），由搜索引擎提取，没有就不出现；不是 ISO 时间。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## 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": "bing",
  "action": "search",
  "params": {
    "keyword": "python asyncio tutorial"
  }
}'
```

```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": "bing",
        "action": "search",
        "params": {
            "keyword": "python asyncio tutorial",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "bing",
  "action": "search",
  "results": [
    {
      "rank": …,
      "title": …,
      "url": …,
      "displayed_url": …,
      "text": …,
      "date_text": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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