← 返回
开发者工具 Key 中文

SmartRoute - Google Routes Calculator

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.
利用 Google Routes API 计算位置之间感知交通路况的路线、行程时间和距离。当用户询问“前往X的交通情况”、“到达Y需要多久”、“到Z的最佳路线”或“驾驶时间”时使用。返回包含时长、距离及 Google 地图导航直链的 JSON 数据。
vemec
开发者工具 clawhub v1.0.4 1 版本 99947.4 Key: 需要
★ 2
Stars
📥 1,859
下载
💾 42
安装
1
版本
#latest

概述

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:

  • "How is the traffic to X?"
  • "How long does it take to drive to Y?"
  • "Give me the route to Z."
  • "What's the distance between A and B?"

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

  • Check traffic in San Francisco:

node skills/smart-route/scripts/get_route.js --origin "Union Square, San Francisco, CA" --destination "Golden Gate Bridge, San Francisco, CA"

  • Drive time in Los Angeles:

node skills/smart-route/scripts/get_route.js --origin "Los Angeles, CA" --destination "Santa Monica, CA" --mode DRIVE

Configuration

Privacy & Security

  • Scope: This skill only communicates with routes.googleapis.com.
  • Data Handling:
  • It does not read local files or other environment variables besides the ones specified below.
  • PII Notice: User-supplied origin and destination addresses are sent to Google Routes API and printed to stdout in the JSON response. Users should consider these addresses as potentially sensitive information (PII).
  • Credentials: API keys must be provided via environment variables. Providing keys via CLI flags is disabled for security reasons (to avoid exposing secrets in process lists).

API Credentials

This skill requires a Google Cloud API Key with the Routes API enabled.

  • Variable: GOOGLE_ROUTES_API_KEY
  • Detection: The skill will check for this environment variable at runtime.
  • Strict Mode: If the variable is missing, the script will exit with an error rather than falling back to other keys, ensuring no accidental usage of incorrect credentials.

Setup 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:

```bash

export GOOGLE_ROUTES_API_KEY="your_api_key_here"

```

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-03-28 20:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,965
productivity

Generate Protoss-style (StarCraft) voice effects using SoX and FFmpeg.

vemec
为任意音频文件添加《星际争霸》神族风格灵能特效,可用作TTS或用户录音的后处理层。
★ 3 📥 2,140
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,624