Sand AISand AI MAGI-2MAGI-2 jest teraz na SandBase: wideo 1080p z natywnym dźwiękiemWypróbuj teraz

Baidu Maps Search

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

Cena
$0.01USD / wywołanie
Metoda
POST
Odpowiedź
JSON
Parametry
1 wymaganych · 5 opcjonalnych

Playground

Wejście
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.
WyjścieGotowe

Twój wynik pojawi się tutaj

Uzupełnij dane wejściowe, a następnie kliknij Uruchom.

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

Odkryj więcej

Powiązane APIs

Wszystkie APIs
APICenaOdpowiedź
Baidu$0.01 za wywołanieJSON
Baidu$0.03 za wywołanieJSON
Baidu$0.03 za wywołanieJSON
Baidu$0.03 za wywołanieJSON
Baidu$0.015 za wywołanieJSON
Baidu$0.03 za wywołanieJSON

Pytania

FAQ

Jak używać API Baidu Maps Search?

Wyślij żądanie POST do https://api.sandbase.ai/v1/api/baidu/maps z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.

Ile kosztuje API Baidu Maps Search?

$0.01 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.

Jakie parametry przyjmuje API Baidu Maps Search?

Wymagane: q (string). Opcjonalne: c (string), lat (string), lon (string), page (string) i json_restrictor (string). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.

Co zwraca API Baidu Maps Search?

Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie).

Czy potrzebuję konta deweloperskiego Baidu lub klucza API?

Nie. Baidu Maps Search działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API Baidu.