# Google Maps Traffic 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. This is a paid API service exposed by Server402 for AI agents, MCP clients, OpenAPI importers, and applications. Call the endpoint once without payment to receive HTTP 402 payment instructions, open xiaopay.top to obtain XIAO, create the guarantee, then retry with X402-Guarantee. ## Invocation - Service ID: `google-maps-traffic` - Canonical service ID: `google-maps-traffic` - Method: `POST` - Endpoint: `https://x402vip.com/api/tools/google-maps-traffic` - Service page: https://x402vip.com/services/google-maps-traffic - OpenAPI: https://x402vip.com/openapi.json - Catalog search: https://x402vip.com/api/catalog/search?q=google-maps-traffic - MCP endpoint: https://x402vip.com/mcp - MCP tool: `google_maps_traffic` ## Pricing And Payment - Price: XIAO 0.01 - Billing mode: `per_call` - Max calls per payment: `1` - Payment provider: `x402_xiao_wallet` - Payment flow: call without payment, receive `402 Payment Required`, open xiaopay.top to obtain XIAO, then retry with `X-Payment-Token` or `X402-Guarantee`. - Payment hint: 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". ## Use Cases - Get traffic-aware driving ETA and route distance between two places - Plan a route from origin to destination with Google Maps Routes API - Return route legs, steps, duration, static duration, traffic delay, and encoded polyline for AI agents - Answer route-related map queries such as 地图查询, 谷歌地图, 路线规划, 实时路况, 开车多久, or 从A到B怎么走 when two places are present ## Keywords Google Maps traffic API, Google Maps Routes API, map query API, maps query, route planning, route planner, route lookup, directions, driving directions, navigation route, traffic-aware ETA, estimated arrival time, travel time, drive time, driving time, commute time, traffic delay, live traffic, road traffic, distance between places, origin destination route, 地图查询, 谷歌地图, 路线查询, 路线规划, 路径规划, 导航路线, 驾车路线, 驾车导航, 实时路况, 交通情况, 交通拥堵, 堵车, 预计到达时间, 开车多久, 从A到B怎么走 ## Input Schema ```json { "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" } ``` ## Output Schema ```json { "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" } ``` ## Example Request ```json { "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" } ``` ## Example Response ```json { "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" } ```