Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

Baidu Maps Search

Docs da API
https://api.sandbase.ai/v1/api/baidu/maps

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

Preço
$0.01USD / chamada
Método
POST
Resposta
JSON
Parâmetros
1 obrigatórios · 5 opcionais

Playground

Entrada
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 City)). Without `c`, the query can include the city to search in (e.g., `上海 咖啡` for coffee in Shanghai).
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 too (e.g., `49872` for Paris): a search near their coordinates returns it in `search_information.city_code`. Without it, Baidu Maps searches in the city named in `q`, in China or abroad, or lists the cities with results in `cities`. With `lat` and `lon`, it searches in the city at the coordinates. With `lat` and `lon`, the city must be the one where the coord
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 coordinates shifted a few hundred meters from GPS coordinates, like all maps of mainland China (a system called GCJ-02). Parameter is required when using `lon` parameter. `c` is optional with coordinates: without it, the city at the coordinates is used. If it's set, it must be the city where the coordinates are.
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 coordinates shifted a few hundred meters from GPS coordinates, like all maps of mainland China (a system called GCJ-02). Parameter is required when using `lat` parameter. `c` is optional with coordinates: without it, the city at the coordinates is used. If it's set, it must be the city where the coordinates are.
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.
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.
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da API

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

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

NameTypeRequiredDescription
qstringYesParameter 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
cstringNoParameter 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
latstringNoParameter 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
lonstringNoParameter 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
pagestringNoValue 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_restrictorstringNoParameter 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.

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
Baidu$0.01 por chamadaJSON
Baidu$0.03 por chamadaJSON
Baidu$0.03 por chamadaJSON
Baidu$0.03 por chamadaJSON
Baidu$0.015 por chamadaJSON
Baidu$0.03 por chamadaJSON

Perguntas

FAQ

Como eu uso a API Baidu Maps Search?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/baidu/maps com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API Baidu Maps Search?

$0.01 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API Baidu Maps Search aceita?

Obrigatórios: q (string). Opcionais: c (string), lat (string), lon (string), page (string) e json_restrictor (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API Baidu Maps Search retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona).

Preciso de uma conta de desenvolvedor Baidu ou de uma chave de API?

Não. Baidu Maps Search funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Baidu separadamente.