# Baidu Maps Search

Returns places from Baidu Maps for a query in one city: name, address, phone, rating, review count, price, opening hours, category tags, brand, thumbnail, detail URL and ids (uid, primary_uid) for chaining. Coordinates come as BD09 latitude and longitude (the system Baidu maps use), a WGS84 approximation for use with other maps, and the raw Baidu values. Pick the city by name from the listed set. Page 0 to 3 returns 10 places each, so at most 40. A request with no places or a failure is not billed.

- **Documentation:** [https://scrappa.co/docs/baidu-api/baidu_maps](https://scrappa.co/docs/baidu-api/baidu_maps)
- **API group:** Baidu API
- **Endpoint:** `GET https://scrappa.co/api/baidu/maps`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | What to find, for example 咖啡 or coffee. |
| `city` | string | Yes | City to search in: an English name, the Chinese name or the Baidu city code of a supported city, for example beijing, 上海 or 257. Others return 422. |
| `page` | integer | No | Result page from 0 to 3, 10 places per page. Default: 0. |

## Example response

```json
{
    "pagination": {
        "page": 0,
        "next_page": 1,
        "total_results": 190,
        "results_on_page": 10
    },
    "local_results": [
        {
            "aoi": "\u5317\u4eac\u897f\u7ad9/\u897f\u5ba2\u7ad9",
            "geo": "1|12949762.65,4824478.53;12949762.65,4824478.53|12949762.65,4824478.53;",
            "uid": "261d9a8f181b11948c1a894d",
            "city": "\u5317\u4eac\u5e02",
            "name": "\u661f\u5df4\u514b(\u5317\u4eac\u5149\u8000\u4e1c\u65b9\u5e97)",
            "tags": [
                "\u7f8e\u98df",
                "\u5496\u5561\u5385"
            ],
            "brand": "\u661f\u5df4\u514b",
            "phone": "010-63950461",
            "price": 49.2,
            "rating": 3.5,
            "address": "\u5317\u4eac\u5e02\u6d77\u6dc0\u533a\u7f8a\u574a\u5e97\u8def18\u53f7\u5149\u8000\u4e1c\u65b9\u5e7f\u573a\u4e00\u5c42103\u5355\u5143",
            "category": "\u7f8e\u98df;\u5496\u5561\u5385",
            "district": "\u6d77\u6dc0\u533a",
            "position": 1,
            "province": "\u5317\u4eac\u5e02",
            "area_name": "\u5317\u4eac\u5e02\u6d77\u6dc0\u533a",
            "city_code": 131,
            "thumbnail": "https://poi-pic.cdn.bcebos.com/swd/28a1b2ce-de00-3b51-afb7-d02a1beaca28.jpg",
            "detail_url": "https://map.baidu.com/mobile/webapp/place/detail/qt=ninf&wd=%E5%92%96%E5%95%A1&c=131&pn=0&uid=261d9a8f181b11948c1a894d",
            "poi_profile": 0,
            "price_label": "\u4eba\u5747\u6d88\u8d39",
            "primary_uid": "16456079247040897390",
            "has_panorama": true,
            "review_count": 17,
            "business_time": {
                "data": [
                    {
                        "business_time_text": {
                            "common": "\u5468\u4e00\u81f3\u5468\u516d 06:00-21:30 \u5468\u65e5 06:30-21:30"
                        }
                    }
                ]
            },
            "opening_hours": "\u5468\u4e00\u81f3\u5468\u4e9407:30-22:00 \u5468\u516d\u81f3\u5468\u65e509:00-22:00",
            "gps_coordinates": {
                "latitude": 39.905002,
                "longitude": 116.328431,
                "coordinate_system": "bd09"
            },
            "raw_coordinates": {
                "x": 1294976265,
                "y": 482447853
            },
            "gps_coordinates_wgs84": {
                "latitude": 39.897907,
                "longitude": 116.315741
            }
        }
    ],
    "response_time_ms": 2600,
    "search_parameters": {
        "city": "beijing",
        "page": 0,
        "query": "\u5496\u5561",
        "engine": "baidu_maps",
        "city_code": 131
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Invalid parameter | query or city is missing, city is not a supported city or page is outside 0 to 3. Not billed. |
| 503 | Upstream unavailable | Baidu could not be reached after safe retries. The request is not billed. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
