This skill uses the Amap Web Service API to provide rich geographic location services.
Important: Before using this skill, you must apply for a Web Service API Key on the Amap Open Platform and set it as the environment variable AMAP_KEY。
export AMAP_KEY="你的Web服务API Key"
Clawdbot will automatically read this environment variable to call the API.
When to Use (Trigger Conditions)
When the user makes the following types of requests, this skill should be used first:
- "Check the weather in [city] for me"
- "Search for [things] near [place]"
- "Find the location of [keyword]"
- "How do I get from [A] to [B]?"
- "Look up the latitude and longitude of [address]"
- "What place is this coordinate [longitude,latitude]?"
Core Features and Usage
1. Weather Query
Used to query real-time weather or weather forecasts for a specified city.
Note: The API requires the city's adcode. If you do not know the adcode, you can first obtain it through the administrative division query feature.
Query real-time weather
# 将 [城市adcode] 替换为实际的行政区编码, 例如北京是 110000
curl "https://restapi.amap.com/v3/weather/weatherInfo?key=$AMAP_KEY&city=[城市adcode]&extensions=base"
Query weather forecast
# 将 [城市adcode] 替换为实际的行政区编码
curl "https://restapi.amap.com/v3/weather/weatherInfo?key=$AMAP_KEY&city=[城市adcode]&extensions=all"
2. Place Search (POI)
Used to search for place information in a specified city based on keywords.
# 将 [关键词] 和 [城市] 替换为用户提供的内容
curl "https://restapi.amap.com/v3/place/text?key=$AMAP_KEY&keywords=[关键词]&city=[城市]"
3. Driving Route Planning
Used to plan a driving route between two locations.
Note: The API requires the latitude and longitude coordinates of the start and end points. If the user provides addresses, you need to first use the geocoding feature to convert the addresses into coordinates.
# 将 [起点经纬度] 和 [终点经纬度] 替换为实际坐标,格式为 "经度,纬度"
curl "https://restapi.amap.com/v3/direction/driving?key=$AMAP_KEY&origin=[起点经纬度]&destination=[终点经纬度]"
4. Geocoding (Address → Coordinates)
Converts structured address information into latitude and longitude coordinates.
# 将 [地址] 替换为用户提供的地址
curl "https://restapi.amap.com/v3/geocode/geo?key=$AMAP_KEY&address=[地址]"
5. Reverse Geocoding (Coordinates → Address)
Converts latitude and longitude coordinates into structured address information.
# 将 [经纬度] 替换为实际坐标,格式为 "经度,纬度"
curl "https://restapi.amap.com/v3/geocode/regeo?key=$AMAP_KEY&location=[经纬度]"
6. Administrative Division Query (Get adcode)
Used to query administrative division information for provinces, cities, districts, and streets, including adcode and boundaries.
# 将 [关键词] 替换为城市或区域名称,例如 "北京市"
curl "https://restapi.amap.com/v3/config/district?key=$AMAP_KEY&keywords=[关键词]&subdistrict=0"