# Baidu Huiyan LBS MCP

> Baidu Huiyan LBS analyzes large-scale population movement across China. Use this MCP to track migration flows, measure real-time urban crowd density, and perform precise geocoding of addresses or coordinates within Chinese boundaries. It gives you macro-level insights into where people move and how crowded a location is.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** mobility-analytics, urban-planning, population-flow, location-intelligence, crowd-density

## Description

This connector links your AI agent directly to Baidu Huiyan, Asia's massive location intelligence platform. You gain the ability to analyze population mobility patterns that standard mapping services miss. Need to know if an area is growing or shrinking? You can track migration flows between provinces and cities. Want to plan a retail space? Query historical and real-time crowd density heatmaps to pinpoint high-footfall zones before you even buy a lease. The MCP handles complex tasks like converting any street address into coordinates, giving you precise geocoding data that works across China's unique system. If your current workflow for location analysis feels too siloed, connecting through the Vinkius catalog gives you access to this specific geospatial power alongside thousands of others. You can also get a demographic profile or calculate how long visitors typically stay in a given region.

## Tools

### geocode_address
This tool converts a specific street address into its corresponding latitude and longitude coordinates.

### get_area_profile
It fetches the demographic and behavioral profile for any defined geographic area you specify.

### get_migration_city_rank
You can rank cities by migration flow volume, specifying if the direction is 'in' or 'out' of a target area.

### get_migration_province_rank
This ranks entire provinces based on their population migration volume relative to a chosen target region.

### get_migration_scale
Get the overall population migration intensity index for an area, defining whether you want 'in' or 'out' flow.

### get_population_density
Retrieves a real-time population density heatmap showing crowd concentration data for a specific location.

### get_population_flow
Calculates the total volume of population inflow or outflow into a designated area.

### get_stay_duration
It provides the average time visitors spend within any given geographic area.

### reverse_geocode
This tool takes latitude and longitude coordinates and converts them back into a structured, readable address.

### search_poi
Search for various Points of Interest (like restaurants or shops) near a location or specific region.

## Prompt Examples

**Prompt:** 
```
Get the crowd density data for the Sanlitun area in Beijing.
```

**Response:** 
```
Querying Huiyan density data... The Sanlitun area (ID: BJ_110105X8) shows a crowd density index of 8.2, at approximately 90% peak capacity. This indicates very high footfall in the retail and entertainment district. Would you like to check adjacent neighborhoods?
```

**Prompt:** 
```
Analyze the inbound migration flow to Shanghai for this week.
```

**Response:** 
```
Analyzing migration data for Shanghai (310000)... The inbound flow index averages 7.15 this week. The top origin city is Suzhou at 28% of total inflow, followed by Hangzhou at 15%. Would you like to see the full city ranking or compare with last week?
```

**Prompt:** 
```
Geocode 'The Bund, Zhongshan East 1st Road, Huangpu, Shanghai' in BD09ll format.
```

**Response:** 
```
Geocoding complete. Address resolved to: Latitude 31.239722, Longitude 121.493888. Confidence: 99%. Coordinate system: BD09ll (Baidu proprietary). Would you like to reverse-geocode these coordinates or search for nearby POIs?
```

## Capabilities

### Map Population Movement
Determine directional population shifts, tracking both inbound and outbound flows relative to specific cities or provinces.

### Monitor Crowd Density
Query real-time density data or calculate the general migration intensity index for any defined geographic area.

### Pinpoint Locations
Convert physical street addresses into precise latitude and longitude coordinates, or vice versa using reverse geocoding.

### Analyze Regional People Trends
Retrieve detailed demographic profiles and behavioral patterns for any administrative region in China.

### Find Local Spots
Search and list points of interest (POIs) near a specific geographical area or coordinate set.

## Use Cases

### Identifying ideal retail spots.
A retail analyst needs to find the perfect spot for a new flagship store. They use `search_poi` around several potential locations and cross-reference the data with crowd density heatmaps from `get_population_density` to ensure maximum pedestrian traffic.

### Optimizing public transit routes.
A city planner notices a gap in their network. They use `get_migration_city_rank` to identify the top origin cities feeding into the target zone, allowing them to justify new bus lines connecting those specific areas.

### Assessing market viability after an event.
A company wants to know if their recent marketing campaign worked. They use `get_population_flow` and compare the inflow volumes before and after the launch date, confirming increased regional interest.

### Understanding consumer behavior across large regions.
A logistics firm needs to adjust its inventory placement. It uses `get_area_profile` for several provinces to see which areas have the highest concentration of specific behavioral patterns, guiding their stocking strategy.

## Benefits

- You immediately know if a location is worth investing in. By running the `get_population_density` tool, you get real-time heatmaps showing exactly where the crowds gather, letting you plan for peak footfall.
- Stop guessing about market growth. Use `get_area_profile` to retrieve detailed demographic and behavioral data, giving you a solid statistical basis when pitching location ideas or designing services.
- You can track directional changes with precision. The MCP lets you check both city-level (`get_migration_city_rank`) and province-level (`get_migration_province_rank`) migration flows to understand market shifts.
- Need an address but don't have coordinates? Use `geocode_address` first, then pass those precise coordinates into tools like `search_poi` for hyper-local results.
- Understand the full picture of movement. By comparing raw flow volumes from `get_population_flow` against average stay durations (`get_stay_duration`), you build a complete picture of visitor engagement.

## How It Works

The bottom line is that once you provide those two keys, your agent manages all the complex signing and querying so you just ask a plain English question.

1. First, you'll create a developer account on the Baidu LBS Open Platform site.
2. Next, register an application to get your Access Key (AK) and then enable SN Verification in the console to generate your Secret Key (SK).
3. Finally, enter both keys into your AI client. The MCP automatically computes the required MD5 SN signature for every request you make.

## Frequently Asked Questions

**How do I use the get_population_density tool?**
You simply ask your agent to check the density for a specific area or coordinates. The MCP returns a heatmap index, telling you if footfall is high (near 100% capacity) or low.

**Is Baidu Huiyan LBS better than general mapping tools?**
Yes, because it provides specialized macro-scale data. General maps show where something *is*; this MCP shows how many people are going there and why they move that way.

**Which tool should I use to find a new office location?**
Start with `get_migration_city_rank` or `get_migration_province_rank` to confirm the area is growing. Then, use `search_poi` and `get_population_density` to verify high foot traffic.

**Can I convert coordinates back into a street address?**
You can use the `reverse_geocode` tool. It takes latitude/longitude pairs and outputs a structured, readable address format.

**Does this MCP only work in China?**
Yes, the data set is specific to Baidu’s massive LBS ecosystem within China's geographic boundaries. It provides highly accurate local context for that region.