amap-traffic
Original:🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected
Skill for real-time traffic query and optimal self-driving route planning based on Amap. It provides real-time congestion information and fastest route recommendations by leveraging Amap Traffic Situation API and Route Planning API.
1installs
Added on
NPX Install
npx skill4agent add agentbay-ai/agentbay-skills amap-trafficTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Amap Real-time Traffic and Route Planning
Overview
This skill is implemented via Amap APIs, including:
- Real-time Traffic Query: Obtain congestion status of specified roads/areas
- Intelligent Route Planning: Calculate the fastest self-driving route based on real-time traffic
- Multi-scheme Comparison: Provide route comparisons in dimensions such as time, distance, cost, etc.
🔑 API Key Configuration
- Visit Amap Open Platform to create a Key
- Set it on the OpenClaw Web configuration page:
Address: http://127.0.0.1:18789/skills
Configuration file field:inskills.entries.amap-traffic.AMAP_KEYopenclaw.json
Value: Your Amap API Key
Note: This skill reads the latestfromAMAP_KEYevery time it is called, supporting immediate effect after dynamic key update on the frontend.openclaw.json
API Usage Instructions
1. Real-time Traffic Query
bash
curl "https://restapi.amap.com/v3/traffic/status/road?roadid={Road ID}&key={Dynamically read AMAP_KEY}"2. Intelligent Route Planning (with real-time traffic)
bash
curl "https://restapi.amap.com/v3/direction/driving?origin={Starting coordinates}&destination={Destination coordinates}&strategy=2&key={Dynamically read AMAP_KEY}"- : Prioritize the fastest route considering real-time traffic
strategy=2
Traffic Status Explanation
- Smooth: 🟢 Green (Speed > 40km/h)
- Slow-moving: 🟡 Yellow (20-40km/h)
- Congested: 🔴 Red (< 20km/h)
- Severely Congested: 🟣 Magenta (< 10km/h)
Resources
scripts/
Contains core scripts for Amap real-time traffic query and route planning.
scripts/amap_traffic.py
Python script that implements complete real-time traffic query and optimal route planning functions.
It reads the latest AMAP_KEY from every time it executes, ensuring immediate effect after dynamic key update on the frontend.
/home/admin/.openclaw/openclaw.json