# Baidu Maps Search API

> Search places on Baidu Maps by keyword in a city or around coordinates, with name, address, category, rating, phone and coordinates.

Source: https://www.sandbase.ai/apis/baidu/maps
API reference: https://www.sandbase.ai/apis/baidu/maps#api

## Facts

- Provider: Baidu
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/baidu/maps`
- Price: $0.01 per call
- Capabilities: api, baidu, maps, local
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/baidu/maps` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `q` | string | yes |  |
| `c` | string | no |  |
| `lat` | string | no |  |
| `lon` | string | no |  |
| `page` | string | no |  |
| `json_restrictor` | string | no |  |

## FAQ

### How do I use the Baidu Maps Search API?

Send a POST request to https://api.sandbase.ai/v1/api/baidu/maps with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Baidu Maps Search API cost?

$0.01 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.

### What parameters does the Baidu Maps Search API accept?

Required: q (string). Optional: c (string), lat (string), lon (string), page (string) and json_restrictor (string). The Parameters table and the Playground on this page list every field.

### What does the Baidu Maps Search API return?

A JSON response returned in the same HTTP request (synchronous).

### Do I need a Baidu developer account or API key?

No. Baidu Maps Search runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Baidu API access separately.

## README

### Baidu Maps Search

Search places on Baidu Maps by keyword in a city or around coordinates, with name, address, category, rating, phone and coordinates.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/baidu/maps" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "咖啡", "c": "131"}'
```

The result is returned in `outputs[0].data` as structured JSON.

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `q` | string | Yes | Parameter defines the search query. You can use anything that you would use in a regular Baidu Maps search: a type of place, a business, a brand, or a landmark (e.g., `咖啡` (coffee), `酒店` (hotels), `星巴克` (Starbucks), or `故宫` (the Forbidden C |
| `c` | string | No | Parameter defines the city to search in, with its Baidu Maps city code (e.g., `131` for Beijing, `289` for Shanghai, or `257` for Guangzhou). Head to the Baidu Maps cities page for the cities of China. Cities in other countries have codes t |
| `lat` | string | No | Parameter defines the latitude to search near (e.g., `39.908776`). Results are the places near these coordinates, and their `distance` field says how far each one is. In China, including Hong Kong, Macau and Taiwan, Baidu Maps uses coordina |
| `lon` | string | No | Parameter defines the longitude to search near (e.g., `116.39759`). Results are the places near these coordinates, and their `distance` field says how far each one is. In China, including Hong Kong, Macau and Taiwan, Baidu Maps uses coordin |
| `page` | string | No | Value is used to get results on a specific page. (e.g., `1` (default) is the first page of results, `2` is the 2nd page of results, `3` is the 3rd page of results, etc.). Baidu Maps returns up to 10 results per page. |
| `json_restrictor` | string | No | Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details. |

#### Pricing

$0.010 per successful call. Failed calls are not charged.
