Invocation
- Service ID
google-maps-traffic- Method
POST- Endpoint
/api/tools/google-maps-traffic- Legacy Endpoint
none- MCP Tool
google_maps_traffic- Price
- XIAO 0.01
Paid API service
Use this paid XIAO Google Maps Routes API service for route planning, driving directions, traffic-aware ETA, travel time, static travel time, traffic delay, route distance, legs, steps, and polyline output between an origin and destination. Strong keywords include map query, route lookup, driving directions, traffic-aware ETA, drive time, commute time, Google Maps Routes API, 地图查询, 谷歌地图, 路线查询, 路线规划, 导航路线, 驾车路线, 实时路况, 交通情况, 堵车, 开车多久, and 从A到B怎么走. It requires origin and destination. It supports addresses, Google Place IDs, and latitude/longitude waypoints. Unpaid calls return HTTP 402 before Google execution. This endpoint does not support standalone nearby search, POI/business search, place details, store hours, reviews, map tiles, or geocoding-only lookup.
google-maps-trafficPOST/api/tools/google-maps-trafficnonegoogle_maps_trafficCall the endpoint without payment to receive HTTP 402 metadata. If payment is required, open xiaopay.top to obtain XIAO, create the guarantee, then retry with X-Payment-Token, an XIAO guarantee header, or MCP paymentToken.
Call POST /api/tools/google-maps-traffic once to receive HTTP 402 with accepts[] requirements. Open https://xiaopay.top to obtain XIAO, create an AI wallet guarantee for merchant_id=aivps.lat and merchant_order_id=payment.paymentId, then retry with X402-Guarantee. If you need the legacy reusable token flow, create a payment with POST /api/payments using serviceId="google-maps-traffic".
{
"exampleRequest": {
"departureTime": "now",
"destination": "Shibuya Crossing, Tokyo, Japan",
"languageCode": "en-US",
"origin": "Tokyo Station, Tokyo, Japan",
"routingPreference": "TRAFFIC_AWARE_OPTIMAL",
"trafficModel": "BEST_GUESS",
"travelMode": "DRIVE",
"units": "METRIC"
},
"exampleResponse": {
"agent_id": "google-maps-traffic",
"route_count": 1,
"routes": [
{
"distance_meters": 6500,
"distance_text": "6.5 km",
"duration_seconds": 1260,
"polyline": {
"encoded_polyline": "example"
},
"route_index": 0,
"static_duration_seconds": 1020,
"traffic_delay_seconds": 240
}
],
"routing_preference": "TRAFFIC_AWARE_OPTIMAL",
"source": "Google Maps Routes API",
"status": "ok",
"traffic_enabled": true,
"travel_mode": "DRIVE"
},
"inputSchema": {
"properties": {
"computeAlternativeRoutes": {
"default": false,
"type": "boolean"
},
"departureTime": {
"description": "RFC3339 timestamp or now.",
"type": "string"
},
"destination": {
"description": "Waypoint for Google Routes API. Provide exactly one of address, placeId, or location.latLng. Strings are treated as addresses.",
"properties": {
"address": {
"description": "Free-form address or place description.",
"type": "string"
},
"location": {
"properties": {
"heading": {
"description": "Optional heading in degrees when using latLng.",
"maximum": 360,
"minimum": 0,
"type": "integer"
},
"latLng": {
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
}
},
"type": "object"
},
"placeId": {
"description": "Google Place ID.",
"type": "string"
},
"sideOfRoad": {
"description": "Whether the waypoint should be on the road side.",
"type": "boolean"
},
"vehicleStopover": {
"description": "Whether the waypoint is a stopover.",
"type": "boolean"
},
"via": {
"description": "Whether the waypoint is a pass-through point.",
"type": "boolean"
}
},
"type": "object"
},
"extraComputations": {
"items": {
"enum": [
"TOLLS",
"TRAFFIC_ON_POLYLINE",
"HTML_FORMATTED_NAVIGATION_INSTRUCTIONS"
],
"type": "string"
},
"type": "array"
},
"intermediates": {
"description": "Optional intermediate waypoints in travel order.",
"items": {
"description": "Waypoint for Google Routes API. Provide exactly one of address, placeId, or location.latLng. Strings are treated as addresses.",
"properties": {
"address": {
"description": "Free-form address or place description.",
"type": "string"
},
"location": {
"properties": {
"heading": {
"description": "Optional heading in degrees when using latLng.",
"maximum": 360,
"minimum": 0,
"type": "integer"
},
"latLng": {
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
}
},
"type": "object"
},
"placeId": {
"description": "Google Place ID.",
"type": "string"
},
"sideOfRoad": {
"description": "Whether the waypoint should be on the road side.",
"type": "boolean"
},
"vehicleStopover": {
"description": "Whether the waypoint is a stopover.",
"type": "boolean"
},
"via": {
"description": "Whether the waypoint is a pass-through point.",
"type": "boolean"
}
},
"type": "object"
},
"type": "array"
},
"languageCode": {
"default": "en-US",
"description": "BCP-47 locale used for route labels.",
"type": "string"
},
"origin": {
"description": "Waypoint for Google Routes API. Provide exactly one of address, placeId, or location.latLng. Strings are treated as addresses.",
"properties": {
"address": {
"description": "Free-form address or place description.",
"type": "string"
},
"location": {
"properties": {
"heading": {
"description": "Optional heading in degrees when using latLng.",
"maximum": 360,
"minimum": 0,
"type": "integer"
},
"latLng": {
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
}
},
"type": "object"
},
"placeId": {
"description": "Google Place ID.",
"type": "string"
},
"sideOfRoad": {
"description": "Whether the waypoint should be on the road side.",
"type": "boolean"
},
"vehicleStopover": {
"description": "Whether the waypoint is a stopover.",
"type": "boolean"
},
"via": {
"description": "Whether the waypoint is a pass-through point.",
"type": "boolean"
}
},
"type": "object"
},
"regionCode": {
"description": "Optional ISO 3166-1 alpha-2 region code.",
"type": "string"
},
"routeModifiers": {
"properties": {
"avoidFerries": {
"type": "boolean"
},
"avoidHighways": {
"type": "boolean"
},
"avoidIndoor": {
"type": "boolean"
},
"avoidTolls": {
"type": "boolean"
}
},
"type": "object"
},
"routingPreference": {
"default": "TRAFFIC_AWARE_OPTIMAL",
"enum": [
"TRAFFIC_UNAWARE",
"TRAFFIC_AWARE",
"TRAFFIC_AWARE_OPTIMAL"
],
"type": "string"
},
"trafficModel": {
"default": "BEST_GUESS",
"enum": [
"BEST_GUESS",
"OPTIMISTIC",
"PESSIMISTIC"
],
"type": "string"
},
"travelMode": {
"default": "DRIVE",
"enum": [
"DRIVE",
"BICYCLE",
"WALK",
"TWO_WHEELER",
"TRANSIT"
],
"type": "string"
},
"units": {
"default": "METRIC",
"enum": [
"METRIC",
"IMPERIAL"
],
"type": "string"
}
},
"required": [
"origin",
"destination"
],
"type": "object"
},
"outputSchema": {
"properties": {
"agent_id": {
"type": "string"
},
"compute_alternative_routes": {
"type": "boolean"
},
"departure_time": {
"type": "string"
},
"destination": {
"type": "object"
},
"fallback_info": {
"type": "object"
},
"geocoding_results": {
"type": "object"
},
"intermediates": {
"items": {
"type": "object"
},
"type": "array"
},
"language_code": {
"type": "string"
},
"notes": {
"items": {
"type": "string"
},
"type": "array"
},
"origin": {
"type": "object"
},
"region_code": {
"type": "string"
},
"request_id": {
"type": "string"
},
"route_count": {
"type": "integer"
},
"route_modifiers": {
"type": "object"
},
"routes": {
"items": {
"properties": {
"description": {
"type": "string"
},
"distance_meters": {
"type": "integer"
},
"distance_text": {
"type": "string"
},
"duration_seconds": {
"type": "integer"
},
"duration_text": {
"type": "string"
},
"legs": {
"items": {
"type": "object"
},
"type": "array"
},
"localized_values": {
"type": "object"
},
"optimized_intermediate_waypoint_indexes": {
"items": {
"type": "integer"
},
"type": "array"
},
"polyline": {
"type": "object"
},
"route_index": {
"type": "integer"
},
"route_labels": {
"items": {
"type": "string"
},
"type": "array"
},
"static_duration_seconds": {
"type": "integer"
},
"static_duration_text": {
"type": "string"
},
"traffic_delay_seconds": {
"type": "integer"
},
"travel_advisory": {
"type": "object"
},
"warning_messages": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"routing_preference": {
"type": "string"
},
"source": {
"type": "string"
},
"source_urls": {
"items": {
"type": "string"
},
"type": "array"
},
"status": {
"type": "string"
},
"traffic_enabled": {
"type": "boolean"
},
"traffic_model": {
"type": "string"
},
"travel_mode": {
"type": "string"
},
"units": {
"type": "string"
}
},
"required": [
"status",
"agent_id",
"request_id",
"origin",
"destination",
"travel_mode",
"routing_preference",
"routes",
"source",
"source_urls"
],
"type": "object"
}
}