Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

Baidu Maps Search

Docs 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.

Prix
$0.01USD / appel
Méthode
POST
Réponse
JSON
Paramètres
1 obligatoires · 5 facultatifs

Bac à sable

Entrée
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.
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

README de l'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.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
Baidu$0.01 par appelJSON
Baidu$0.03 par appelJSON
Baidu$0.03 par appelJSON
Baidu$0.03 par appelJSON
Baidu$0.015 par appelJSON
Baidu$0.03 par appelJSON

Questions

FAQ

Comment utiliser l’API Baidu Maps Search ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/baidu/maps avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.

Combien coûte l’API Baidu Maps Search ?

$0.01 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.

Quels paramètres l’API Baidu Maps Search accepte-t-elle ?

Obligatoire : q (string). Facultatif : c (string), lat (string), lon (string), page (string) et json_restrictor (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.

Que renvoie l’API Baidu Maps Search ?

Une réponse JSON renvoyée dans la même requête HTTP (synchrone).

Ai-je besoin d’un compte développeur ou d’une clé API Baidu ?

Non. Baidu Maps Search fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Baidu séparément.