### Install Baidu Map MCP Server (Node.js) Source: https://context7.com/baidu-maps/mcp/llms.txt Installs the Baidu Map MCP Server for Node.js using npm. This command is used to add the necessary package to your Node.js project. ```bash npm install @baidumap/mcp-server-baidu-map ``` -------------------------------- ### Install Baidu Map MCP Server (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Installs the Baidu Map MCP Server for Python using pip. This is the first step to using the server's LBS functionalities within a Python environment. ```bash pip install mcp-server-baidu-maps ``` -------------------------------- ### Qianfan AppBuilder Integration with MCP Tools (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Provides a Python example for integrating Baidu's Qianfan AppBuilder with MCP tools. It defines a custom event handler to process tool calls, connects to the MCP server, and runs a conversation with the AppBuilder client, demonstrating how to use map capabilities within AI agents. ```python import os import asyncio import appbuilder from appbuilder.core.console.appbuilder_client.async_event_handler import ( AsyncAppBuilderEventHandler, ) from appbuilder.mcp_server.client import MCPClient class MyEventHandler(AsyncAppBuilderEventHandler): def __init__(self, mcp_client): super().__init__() self.mcp_client = mcp_client async def interrupt(self, run_context, run_response): thought = run_context.current_thought print(f"Agent thinking: {thought}") tool_output = [] for tool_call in run_context.current_tool_calls: # Call MCP tool mcp_result = await self.mcp_client.call_tool( tool_call.function.name, tool_call.function.arguments ) tool_res = "" for content in mcp_result.content: if content.type == "text": tool_res += content.text tool_output.append({ "tool_call_id": tool_call.id, "output": tool_res, }) return tool_output async def success(self, run_context, run_response): print(f"Agent response: {run_response.answer}") async def main(): os.environ["APPBUILDER_TOKEN"] = "YOUR_APPBUILDER_TOKEN" app_id = "YOUR_APP_ID" appbuilder_client = appbuilder.AsyncAppBuilderClient(app_id) mcp_client = MCPClient() await mcp_client.connect_to_server("./path/to/map.py") # Get available tools print(mcp_client.tools) # Create conversation and run conversation_id = await appbuilder_client.create_conversation() with await appbuilder_client.run_with_handler( conversation_id=conversation_id, query="开车导航从北京到上海", tools=mcp_client.tools, event_handler=MyEventHandler(mcp_client), ) as run: await run.until_done() await appbuilder_client.http_client.session.close() if __name__ == "__main__": asyncio.get_event_loop().run_until_complete(main()) ``` -------------------------------- ### Map Search Places Tool Call (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Shows how to perform POI searches using the `map_search_places` tool in Python. Examples cover city-wide searches, nearby searches with radius, and international searches, with options for filtering by tags. ```python # City-wide search tool_name = "map_search_places" arguments = { "query": "咖啡厅", "region": "北京市", "tag": "美食,咖啡", "is_china": "true" } # Nearby search with radius arguments = { "query": "餐厅", "location": "39.915,116.404", # lat,lng format "radius": 1000, # meters "is_china": "true" } # International search arguments = { "query": "sushi restaurant", "region": "东京", "is_china": "false" } ``` -------------------------------- ### Map Geocoding Tool Call (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Demonstrates how to call the `map_geocode` tool in Python to convert addresses into geographic coordinates. It shows examples for China mainland addresses, intersections, and international locations. ```python # MCP Tool Call tool_name = "map_geocode" arguments = { "address": "北京市海淀区上地十街十号", "is_china": "true" # Set to "false" for locations outside China mainland } # Example with intersection description arguments = { "address": "北一环路和阜阳路的交叉路口", "is_china": "true" } # International location example arguments = { "address": "Tokyo Tower, Japan", "is_china": "false" } ``` -------------------------------- ### Map Reverse Geocoding Tool Call (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Illustrates how to use the `map_reverse_geocode` tool in Python to get address details from latitude and longitude coordinates. The response includes formatted address, administrative components, and nearby POIs. ```python # MCP Tool Call tool_name = "map_reverse_geocode" arguments = { "latitude": 40.05132, "longitude": 116.34541 } ``` -------------------------------- ### Configure Python MCP Client (Claude/Cursor) Source: https://context7.com/baidu-maps/mcp/llms.txt Configuration for using the Baidu Map MCP Server with Python clients like Claude or Cursor. It specifies the command to run the server and sets the Baidu Maps API key as an environment variable. ```json { "mcpServers": { "baidu-maps": { "command": "python", "args": ["-m", "mcp_server_baidu_maps"], "env": { "BAIDU_MAPS_API_KEY": "" } } } } ``` -------------------------------- ### Configure Node.js MCP Client (Claude/Cursor) Source: https://context7.com/baidu-maps/mcp/llms.txt Configuration for using the Baidu Map MCP Server with Node.js clients like Claude or Cursor. It defines the command to execute the server and sets the Baidu Maps API key. ```json { "mcpServers": { "baidu-map": { "command": "npx", "args": ["-y", "@baidumap/mcp-server-baidu-map"], "env": { "BAIDU_MAP_API_KEY": "" } } } } ``` -------------------------------- ### Query Road Traffic Conditions (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Demonstrates how to query real-time traffic conditions using the map_road_traffic tool. Supports queries by road name, rectangular bounds, circular areas, and polygons. Requires specifying the model type and relevant parameters like road name, city, bounds, center, radius, or vertexes. ```python # Query by road name tool_name = "map_road_traffic" arguments = { "model": "road", "road_name": "朝阳路南向北", "city": "北京市" } # Query by rectangular bounds arguments = { "model": "bound", "bounds": "39.912078,116.464303;39.918276,116.475442" # lat,lng;lat,lng } # Query by circular area arguments = { "model": "around", "center": "39.912078,116.464303", "radius": 500 # meters (1-1000) } # Query by polygon arguments = { "model": "polygon", "vertexes": "39.910528,116.472926;39.918276,116.475442;39.916671,116.459056" } ``` -------------------------------- ### Configure Streamable HTTP MCP Server Source: https://context7.com/baidu-maps/mcp/llms.txt Configuration for connecting to the Baidu Map MCP Server using Streamable HTTP, which is the recommended method. It requires the server URL and your Baidu Maps API key. ```json { "mcpServers": { "baidu-maps-StreamableHTTP": { "url": "https://mcp.map.baidu.com/mcp?ak=YOUR_API_KEY" } } } ``` -------------------------------- ### Query Weather Information using map_weather Source: https://context7.com/baidu-maps/mcp/llms.txt Queries real-time weather conditions and 5-day forecasts using either administrative district codes or coordinates. The response includes temperature, humidity, wind conditions, weather alerts, and hourly forecasts. Requires location (coordinates or district_id) and an is_china flag. ```python # Query by coordinates tool_name = "map_weather" arguments = { "location": "116.404,39.915", # lng,lat format "is_china": "true" } # Query by district code arguments = { "district_id": "110108", # Beijing Haidian "is_china": "true" } # Expected Response { "status": 0, "result": { "location": { "province": "北京市", "city": "北京市", "name": "海淀区" }, "now": { "text": "晴", "temp": 25, "feels_like": 26, "rh": 45, "wind_class": "3级", "wind_dir": "东北风" }, "forecasts": [ { "date": "2024-06-15", "week": "星期六", "high": 32, "low": 20, "text_day": "晴", "text_night": "多云", "wd_day": "东风", "wc_day": "3-4级" } ], "alerts": [ { "type": "高温", "level": "黄色", "title": "高温黄色预警", "desc": "预计最高气温将达35℃以上" } ] } } ``` -------------------------------- ### Plan Routes using map_directions Source: https://context7.com/baidu-maps/mcp/llms.txt Plans routes between two locations for driving, walking, cycling, or public transit. It supports both place names and coordinates as origin/destination and can automatically geocode text addresses. Requires origin, destination, mode, and an is_china flag. ```python # Driving route with coordinates tool_name = "map_directions" arguments = { "origin": "39.915,116.404", "destination": "40.056,116.308", "model": "driving", "is_china": "true" } # Walking route with place names arguments = { "origin": "北京天安门", "destination": "北京故宫博物院", "model": "walking", "is_china": "true" } # Public transit route arguments = { "origin": "北京站", "destination": "北京西站", "model": "transit", "is_china": "true" } # Expected Response { "status": 0, "result": { "routes": [ { "distance": 15234, # meters "duration": 1800, # seconds "steps": [ { "instruction": "从起点向东行驶500米", "distance": 500, "duration": 60 }, { "instruction": "右转进入中关村大街", "distance": 2000, "duration": 180 } ] } ] } } ``` -------------------------------- ### Retrieve Place Details using map_place_details Source: https://context7.com/baidu-maps/mcp/llms.txt Fetches detailed information for a specific Point of Interest (POI) using its unique identifier (uid). The returned data includes ratings, business hours, and contact details, varying by POI type. Requires the POI's uid and a boolean indicating if it's in China. ```python # MCP Tool Call tool_name = "map_place_details" arguments = { "uid": "poi_12345", "is_china": "true" } # Expected Response { "status": 0, "result": { "uid": "poi_12345", "name": "星巴克(中关村店)", "location": {"lat": 39.984, "lng": 116.307}, "address": "北京市海淀区中关村大街1号", "province": "北京市", "city": "北京市", "area": "海淀区", "detail_info": { "tag": "美食;咖啡厅", "overall_rating": "4.5", "shop_hours": "07:00-22:00", "comment_num": "1256" } } } ``` -------------------------------- ### Configure SSE Remote MCP Server Source: https://context7.com/baidu-maps/mcp/llms.txt Configuration for connecting to the Baidu Map MCP Server via Server-Sent Events (SSE) over HTTP. This requires the server URL and your Baidu Maps API key. ```json { "mcpServers": { "baidu-maps-SSE": { "url": "https://mcp.map.baidu.com/sse?ak=YOUR_API_KEY" } } } ``` -------------------------------- ### Extract POI Information from Text (Python) Source: https://context7.com/baidu-maps/mcp/llms.txt Shows how to extract Points of Interest (POI) from unstructured text using the map_poi_extract tool. This functionality requires advanced API permissions and takes a text content string as input, returning a structured list of identified POIs with their names, UIDs, and locations. ```python # MCP Tool Call tool_name = "map_poi_extract" arguments = { "text_content": "新疆独库公路和塔里木湖太美了,从独山子大峡谷到天山神秘大峡谷也是很不错的体验" } ``` -------------------------------- ### Calculate Multiple Route Distances/Times using map_directions_matrix Source: https://context7.com/baidu-maps/mcp/llms.txt Calculates distances and travel times for multiple origin-destination pairs in a single request. It supports driving, walking, and cycling modes, with a limit of 100 routes per request for driving. Input origins and destinations should be pipe-separated strings. ```python # MCP Tool Call tool_name = "map_directions_matrix" arguments = { "origins": "39.915,116.404|40.056,116.308", # Multiple origins separated by | "destinations": "39.984,116.307|40.012,116.339", # Multiple destinations separated by | "model": "driving" # Options: driving, walking, riding } # Expected Response { "status": 0, "result": [ { "distance": {"text": "15.2公里", "value": "15234"}, "duration": {"text": "30分钟", "value": "1800"} }, { "distance": {"text": "8.5公里", "value": "8500"}, "duration": {"text": "18分钟", "value": "1080"} } ] } ``` -------------------------------- ### map_weather Source: https://context7.com/baidu-maps/mcp/llms.txt Queries real-time weather conditions and 5-day forecasts by administrative district code or coordinates. Returns temperature, humidity, wind conditions, weather alerts, and hourly forecasts. ```APIDOC ## GET /map_weather ### Description Queries real-time weather conditions and 5-day forecasts by administrative district code or coordinates. Returns temperature, humidity, wind conditions, weather alerts, and hourly forecasts. ### Method GET ### Endpoint /map_weather ### Parameters #### Query Parameters - **location** (string) - Required if `district_id` is not provided. The geographic coordinates in "lng,lat" format. - **district_id** (string) - Required if `location` is not provided. The administrative district code. - **is_china** (boolean) - Optional - Specifies if the location is in China. Defaults to true. ### Request Example ```json { "location": "116.404,39.915", "is_china": "true" } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the request. - **result** (object) - The weather information. - **location** (object) - The location details. - **province** (string) - The province name. - **city** (string) - The city name. - **name** (string) - The district or area name. - **now** (object) - Real-time weather conditions. - **text** (string) - A textual description of the current weather (e.g., "晴"). - **temp** (integer) - The current temperature in Celsius. - **feels_like** (integer) - The "feels like" temperature in Celsius. - **rh** (integer) - The relative humidity in percentage. - **wind_class** (string) - The wind force level (e.g., "3级"). - **wind_dir** (string) - The wind direction (e.g., "东北风"). - **forecasts** (array) - An array of daily forecasts for the next 5 days. - **date** (string) - The date of the forecast (YYYY-MM-DD). - **week** (string) - The day of the week. - **high** (integer) - The predicted high temperature for the day. - **low** (integer) - The predicted low temperature for the day. - **text_day** (string) - The weather description for the daytime. - **text_night** (string) - The weather description for the nighttime. - **wd_day** (string) - The wind direction during the day. - **wc_day** (string) - The wind force during the day. - **alerts** (array) - An array of weather alerts. - **type** (string) - The type of alert (e.g., "高温"). - **level** (string) - The severity level of the alert (e.g., "黄色"). - **title** (string) - The title of the alert. - **desc** (string) - A description of the alert. #### Response Example ```json { "status": 0, "result": { "location": { "province": "北京市", "city": "北京市", "name": "海淀区" }, "now": { "text": "晴", "temp": 25, "feels_like": 26, "rh": 45, "wind_class": "3级", "wind_dir": "东北风" }, "forecasts": [ { "date": "2024-06-15", "week": "星期六", "high": 32, "low": 20, "text_day": "晴", "text_night": "多云", "wd_day": "东风", "wc_day": "3-4级" } ], "alerts": [ { "type": "高温", "level": "黄色", "title": "高温黄色预警", "desc": "预计最高气温将达35℃以上" } ] } } ``` ``` -------------------------------- ### map_directions Source: https://context7.com/baidu-maps/mcp/llms.txt Plans routes between two locations supporting driving, walking, cycling, and public transit modes. Accepts both place names and coordinates as origin/destination. Automatically geocodes text addresses. ```APIDOC ## GET /map_directions ### Description Plans routes between two locations supporting driving, walking, cycling, and public transit modes. Accepts both place names and coordinates as origin/destination. Automatically geocodes text addresses. ### Method GET ### Endpoint /map_directions ### Parameters #### Query Parameters - **origin** (string) - Required - The starting point of the route. Can be coordinates (lat,lng) or a place name. - **destination** (string) - Required - The ending point of the route. Can be coordinates (lat,lng) or a place name. - **model** (string) - Required - The mode of transport. Options: "driving", "walking", "cycling", "transit". - **is_china** (boolean) - Optional - Specifies if the route is within China. Defaults to true. ### Request Example ```json { "origin": "39.915,116.404", "destination": "40.056,116.308", "model": "driving", "is_china": "true" } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the request. - **result** (object) - The route information. - **routes** (array) - An array of possible routes. - **distance** (integer) - The total distance of the route in meters. - **duration** (integer) - The total duration of the route in seconds. - **steps** (array) - An array of steps for the route. - **instruction** (string) - The instruction for the current step. - **distance** (integer) - The distance of the current step in meters. - **duration** (integer) - The duration of the current step in seconds. #### Response Example ```json { "status": 0, "result": { "routes": [ { "distance": 15234, "duration": 1800, "steps": [ { "instruction": "从起点向东行驶500米", "distance": 500, "duration": 60 }, { "instruction": "右转进入中关村大街", "distance": 2000, "duration": 180 } ] } ] } } ``` ``` -------------------------------- ### map_place_details Source: https://context7.com/baidu-maps/mcp/llms.txt Retrieves detailed information about a specific POI using its unique identifier (uid). Returns data such as ratings, business hours, and detailed contact information depending on the POI type. ```APIDOC ## GET /map_place_details ### Description Retrieves detailed information about a specific Point of Interest (POI) using its unique identifier (uid). Returns data such as ratings, business hours, and detailed contact information depending on the POI type. ### Method GET ### Endpoint /map_place_details ### Parameters #### Query Parameters - **uid** (string) - Required - The unique identifier of the POI. - **is_china** (boolean) - Optional - Specifies if the POI is in China. Defaults to true. ### Request Example ```json { "uid": "poi_12345", "is_china": "true" } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the request. - **result** (object) - The details of the POI. - **uid** (string) - The unique identifier of the POI. - **name** (string) - The name of the POI. - **location** (object) - The geographic coordinates of the POI. - **lat** (number) - Latitude. - **lng** (number) - Longitude. - **address** (string) - The address of the POI. - **province** (string) - The province of the POI. - **city** (string) - The city of the POI. - **area** (string) - The district or area of the POI. - **detail_info** (object) - Additional details about the POI. - **tag** (string) - Tags associated with the POI (e.g., "美食;咖啡厅"). - **overall_rating** (string) - The overall rating of the POI. - **shop_hours** (string) - The business hours of the POI. - **comment_num** (string) - The number of comments for the POI. #### Response Example ```json { "status": 0, "result": { "uid": "poi_12345", "name": "星巴克(中关村店)", "location": {"lat": 39.984, "lng": 116.307}, "address": "北京市海淀区中关村大街1号", "province": "北京市", "city": "北京市", "area": "海淀区", "detail_info": { "tag": "美食;咖啡厅", "overall_rating": "4.5", "shop_hours": "07:00-22:00", "comment_num": "1256" } } } ``` ``` -------------------------------- ### map_directions_matrix Source: https://context7.com/baidu-maps/mcp/llms.txt Calculates distances and travel times for multiple origin-destination pairs in a single request. Supports driving, walking, and cycling modes. Maximum 100 routes per request for driving. ```APIDOC ## GET /map_directions_matrix ### Description Calculates distances and travel times for multiple origin-destination pairs in a single request. Supports driving, walking, and cycling modes. Maximum 100 routes per request for driving. ### Method GET ### Endpoint /map_directions_matrix ### Parameters #### Query Parameters - **origins** (string) - Required - A pipe-separated string of origins. Each origin can be coordinates (lat,lng) or a place name. - **destinations** (string) - Required - A pipe-separated string of destinations. Each destination can be coordinates (lat,lng) or a place name. - **model** (string) - Required - The mode of transport. Options: "driving", "walking", "riding". ### Request Example ```json { "origins": "39.915,116.404|40.056,116.308", "destinations": "39.984,116.307|40.012,116.339", "model": "driving" } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the request. - **result** (array) - An array of objects, where each object represents the distance and duration between an origin-destination pair. - **distance** (object) - The distance information. - **text** (string) - The distance in a human-readable format (e.g., "15.2公里"). - **value** (string) - The distance in meters. - **duration** (object) - The duration information. - **text** (string) - The duration in a human-readable format (e.g., "30分钟"). - **value** (string) - The duration in seconds. #### Response Example ```json { "status": 0, "result": [ { "distance": {"text": "15.2公里", "value": "15234"}, "duration": {"text": "30分钟", "value": "1800"} }, { "distance": {"text": "8.5公里", "value": "8500"}, "duration": {"text": "18分钟", "value": "1080"} } ] } ``` ``` -------------------------------- ### Reverse Geocoding API Source: https://context7.com/baidu-maps/mcp/llms.txt Retrieves address information, administrative divisions, roads, and nearby POIs from latitude and longitude coordinates using Baidu's bd09ll coordinate system. ```APIDOC ## POST /map_reverse_geocode ### Description Retrieves address information, administrative divisions, roads, and nearby POIs from latitude and longitude coordinates. Uses Baidu's bd09ll coordinate system. ### Method POST ### Endpoint /map_reverse_geocode ### Parameters #### Query Parameters - **latitude** (float) - Required - The latitude coordinate. - **longitude** (float) - Required - The longitude coordinate. ### Request Example ```json { "latitude": 40.05132, "longitude": 116.34541 } ``` ### Response #### Success Response (200) - **status** (integer) - Status code, 0 for success. - **result** (object) - Contains reverse geocoding results. - **location** (object) - Geographic coordinates. - **lng** (float) - Longitude. - **lat** (float) - Latitude. - **formatted_address** (string) - The formatted address. - **business** (string) - The business district. - **addressComponent** (object) - Components of the address. - **country** (string) - Country. - **province** (string) - Province. - **city** (string) - City. - **district** (string) - District. - **town** (string) - Town. - **street** (string) - Street. - **street_number** (string) - Street number. - **pois** (array) - List of nearby Points of Interest. - **name** (string) - Name of the POI. - **uid** (string) - Unique identifier for the POI. - **distance** (integer) - Distance from the given coordinates. - **sematic_description** (string) - Semantic description of the location. #### Response Example ```json { "status": 0, "result": { "location": { "lng": 116.34541, "lat": 40.05132 }, "formatted_address": "北京市海淀区上地十街", "business": "上地", "addressComponent": { "country": "中国", "province": "北京市", "city": "北京市", "district": "海淀区", "town": "上地街道", "street": "上地十街", "street_number": "10号" }, "pois": [ { "name": "百度科技园", "uid": "abc123xyz", "distance": 50 } ], "sematic_description": "百度科技园东北方向100米" } } ``` ``` -------------------------------- ### Determine IP Address Location using map_ip_location Source: https://context7.com/baidu-maps/mcp/llms.txt Determines the geographic location of an IP address, returning city name, coordinates, and administrative region. It supports both IPv4 and IPv6. If the IP address is omitted, it will locate the current device's IP. Requires the IP address as an optional parameter. ```python # MCP Tool Call tool_name = "map_ip_location" arguments = { "ip": "220.181.38.148" # Optional - empty returns current device location } ``` -------------------------------- ### Geocoding API Source: https://context7.com/baidu-maps/mcp/llms.txt Converts a text address into geographic coordinates (latitude and longitude). Supports both structured addresses and intersection descriptions for China mainland and international locations. ```APIDOC ## POST /map_geocode ### Description Converts a text address into geographic coordinates (latitude and longitude). Supports both structured addresses and intersection descriptions. The more complete the address structure, the higher the parsing accuracy. Works for both China mainland and international locations. ### Method POST ### Endpoint /map_geocode ### Parameters #### Query Parameters - **address** (string) - Required - The text address to geocode. - **is_china** (boolean) - Optional - Set to `true` for locations within China mainland, `false` for international locations. Defaults to `true`. ### Request Example ```json { "address": "北京市海淀区上地十街十号", "is_china": true } ``` ### Response #### Success Response (200) - **status** (integer) - Status code, 0 for success. - **result** (object) - Contains geocoding results. - **location** (object) - Geographic coordinates. - **lng** (float) - Longitude. - **lat** (float) - Latitude. - **precise** (integer) - Precision level. - **confidence** (integer) - Parsing confidence. - **comprehension** (integer) - Address comprehension score. - **level** (string) - The level of the address parsed (e.g., "门址"). #### Response Example ```json { "status": 0, "result": { "location": { "lng": 116.34541, "lat": 40.05132 }, "precise": 1, "confidence": 80, "comprehension": 100, "level": "门址" } } ``` ``` -------------------------------- ### map_ip_location Source: https://context7.com/baidu-maps/mcp/llms.txt Determines geographic location from an IP address. Returns city name, coordinates, and administrative region. Supports both IPv4 and IPv6. If IP is empty, locates the current device. ```APIDOC ## GET /map_ip_location ### Description Determines geographic location from an IP address. Returns city name, coordinates, and administrative region. Supports both IPv4 and IPv6. If IP is empty, locates the current device. ### Method GET ### Endpoint /map_ip_location ### Parameters #### Query Parameters - **ip** (string) - Optional - The IP address to geolocate. If omitted, the location of the current device will be returned. ### Request Example ```json { "ip": "220.181.38.148" } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the request. - **result** (object) - The geolocation information. - **address** (string) - The address associated with the IP. - **content** (object) - The content of the geolocation result. - **address_detail** (object) - Detailed address information. - **province** (string) - The province name. - **city** (string) - The city name. - **district** (string) - The district name. - **street** (string) - The street name. - **street_number** (string) - The street number. - **adcode** (string) - The administrative division code. - **point** (object) - The geographic coordinates. - **x** (string) - The longitude. - **y** (string) - The latitude. - **type** (string) - The type of location (e.g., "isp"). - **is_foreign** (integer) - Indicates if the location is foreign (1 for foreign, 0 for domestic). - **status** (integer) - The status of the geolocation result. #### Response Example ```json { "status": 0, "result": { "address": "", "content": { "address_detail": { "province": "北京市", "city": "北京市", "district": "海淀区", "street": "中关村大街", "street_number": "1号", "adcode": "110108" }, "point": {"x": "116.307000", "y": "39.984000"}, "type": "isp", "is_foreign": 0, "status": 1 } } } ``` ``` -------------------------------- ### POI Search API Source: https://context7.com/baidu-maps/mcp/llms.txt Searches for POIs (Points of Interest) within a city or circular area. Supports keyword search, tag filtering, and radius-based nearby search for domestic and international locations. ```APIDOC ## POST /map_search_places ### Description Searches for POIs (Points of Interest) within a city or circular area. Supports keyword search, tag filtering, and radius-based nearby search. Works for both domestic and international locations. ### Method POST ### Endpoint /map_search_places ### Parameters #### Query Parameters - **query** (string) - Required - The search keyword or query. - **region** (string) - Optional - The city or region to search within. Required for city-wide searches. - **tag** (string) - Optional - Comma-separated tags to filter POIs (e.g., "美食,咖啡"). - **location** (string) - Optional - The center point for a nearby search in "latitude,longitude" format. - **radius** (integer) - Optional - The search radius in meters for nearby searches. - **is_china** (boolean) - Optional - Set to `true` for locations within China mainland, `false` for international locations. Defaults to `true`. ### Request Example ```json { "query": "咖啡厅", "region": "北京市", "tag": "美食,咖啡", "is_china": true } ``` ### Request Example (Nearby Search) ```json { "query": "餐厅", "location": "39.915,116.404", "radius": 1000, "is_china": true } ``` ### Request Example (International Search) ```json { "query": "sushi restaurant", "region": "东京", "is_china": false } ``` ### Response #### Success Response (200) - **status** (integer) - Status code, 0 for success. - **results** (array) - List of POI search results. - **name** (string) - Name of the POI. - **location** (object) - Geographic coordinates. - **lat** (float) - Latitude. - **lng** (float) - Longitude. - **address** (string) - The address of the POI. - **province** (string) - Province of the POI. - **city** (string) - City of the POI. - **area** (string) - Area/District of the POI. - **uid** (string) - Unique identifier for the POI. - **telephone** (string) - Telephone number of the POI. #### Response Example ```json { "status": 0, "results": [ { "name": "星巴克(中关村店)", "location": {"lat": 39.984, "lng": 116.307}, "address": "北京市海淀区中关村大街", "province": "北京市", "city": "北京市", "area": "海淀区", "uid": "poi_12345", "telephone": "010-12345678" } ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.