# Bing 地图 关键词搜索 API (bing_maps.search)

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 在地图上搜什么，商家名或品类（如 coffee、pizza）。 |
| language | not declared | no | not declared | 结果语言，两位语言代码（如 en、de）。 |
| latitude | not declared | no | not declared | 地图中心纬度（-90 到 90），和 longitude 一起给；不给按 Bing 的默认位置，结果可能不在你要的城市。 |
| longitude | not declared | no | not declared | 地图中心经度（-180 到 180），和 latitude 一起给。 |
| page | integer | no | not declared | 第几页，从 1 开始，每页 limit 个，最多 20 页。 |
| limit | integer (1–30) | no | 20 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 该商家在这次搜索结果里的名次，从 1 开始。 |
| place_id | Bing 地图的商家 ID（如 YNF9439D454244F274），在 Bing 地图链接里用来定位这个商家。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| url | 该记录在原平台上的可访问链接。 |
| category | 分类名称，取值为原平台的分类体系，未做跨平台归一。 |
| address | 详细地址，原文透传。 |
| lat | 纬度。 |
| lng | 经度。 |
| phone | 联系电话，原文透传，未做号码格式归一。 |
| website | 账号或商家填写的外链网址。 |
| rating | 评分，多半来自第三方点评站（见 rating_source），按那家的分制。 |
| rating_scale | 上一列 `rating` 的满分。5 表示五星制、10 表示十分制。只在该行有 rating 时出现。 |
| review_count | 评分来源站上的点评数。 |
| rating_source | 评分和点评数来自哪家点评站（如 Yelp、TripAdvisor）；Bing 自己不打分。 |
| open_state | 搜索时的营业状态原文（如 Open、Closed），按搜索那一刻和商家当地时间。 |
| hours_text | 营业时间提示原文（如 Open until 8 PM）；Bing 没给就不出现。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| 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_maps",
  "action": "search",
  "params": {
    "keyword": "coffee"
  }
}'
```

```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_maps",
        "action": "search",
        "params": {
            "keyword": "coffee",
        },
    },
    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_maps",
  "action": "search",
  "results": [
    {
      "rank": …,
      "place_id": …,
      "name": …,
      "url": …,
      "category": …,
      "address": …,
      "lat": …,
      "lng": …,
      "phone": …,
      "website": …,
      "rating": …,
      "rating_scale": …,
      "review_count": …,
      "rating_source": …,
      "open_state": …,
      "hours_text": …,
      "image_url": …,
      "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_maps
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
