π¦ ClawHub
SmartRoute - Google Routes Calculator
by @vemec
Calculate traffic-aware routes, travel times, and distances between locations using Google Routes API. Use when the user asks for "traffic to X", "how long to get to Y", "best route to Z", or "drive time". Returns JSON with duration, distance, and a direct Google Maps navigation link.
TERMINAL
clawhub install smart-routeπ About This Skill
name: smart-route description: Calculate traffic-aware routes, travel times, and distances between locations using Google Routes API. Use when the user asks for "traffic to X", "how long to get to Y", "best route to Z", or "drive time". Returns JSON with duration, distance, and a direct Google Maps navigation link. metadata: openclaw: emoji: π¦ requires: bins: - node env: - GOOGLE_ROUTES_API_KEY
Google Routes Calculator
Get real-time traffic and routing information via Google Routes API (v2).
When to use
Use this skill immediately when the user asks:
Usage
This skill executes a Node.js script. It requires an API Key with "Routes API" enabled.
Command
node skills/smart-route/scripts/get_route.js --origin "Origin Address" --destination "Destination Address" [--mode DRIVE|BICYCLE|WALK]
Output Format
The script returns a JSON object:
{
"origin": "Union Square, San Francisco, CA",
"destination": "Golden Gate Bridge, San Francisco, CA",
"mode": "DRIVE",
"duration": "30 min",
"distance": "13.5 km",
"traffic_duration_seconds": 1835,
"route_link": "https://www.google.com/maps/dir/?api=1&origin=...&destination=...&travelmode=driving"
}
Examples
node skills/smart-route/scripts/get_route.js --origin "Union Square, San Francisco, CA" --destination "Golden Gate Bridge, San Francisco, CA"node skills/smart-route/scripts/get_route.js --origin "Los Angeles, CA" --destination "Santa Monica, CA" --mode DRIVEConfiguration
Privacy & Security
routes.googleapis.com.API Credentials
This skill requires a Google Cloud API Key with the Routes API enabled.GOOGLE_ROUTES_API_KEYSetup Instructions
1. Open the Google Cloud Console. 2. Enable the Routes API for your project. 3. Generate an API Key under Credentials. 4. Export the key to your environment: export GOOGLE_ROUTES_API_KEY="your_api_key_here"
β‘ When to Use
π‘ Examples
node skills/smart-route/scripts/get_route.js --origin "Union Square, San Francisco, CA" --destination "Golden Gate Bridge, San Francisco, CA"node skills/smart-route/scripts/get_route.js --origin "Los Angeles, CA" --destination "Santa Monica, CA" --mode DRIVEβοΈ Configuration
Privacy & Security
routes.googleapis.com.API Credentials
This skill requires a Google Cloud API Key with the Routes API enabled.GOOGLE_ROUTES_API_KEYSetup Instructions
1. Open the Google Cloud Console. 2. Enable the Routes API for your project. 3. Generate an API Key under Credentials. 4. Export the key to your environment: export GOOGLE_ROUTES_API_KEY="your_api_key_here"