Actions72
- eBay Search
- DuckDuckGo Search
- Amazon Search
- Baidu Search
- Bing Images
- Bing Search
- Facebook Profile
- Google AI Mode
- Google AI Overview
- Google Autocomplete
- Google Finance
- Google Flights
- Google Hotels
- Google Images
- Google Images Light
- Google Immersive Product
- Google Jobs
- Google Lens
- Google Light
- Google Local
- Google Maps
- Google Maps Directions
- Google Maps Reviews
- Google News
- Google News Light
- Google Play Games
- Google Play Product
- Google Play Store
- Google Product
- Google Scholar
- Google Search
- Google Shopping
- Google Trends
- Google Trends Trending Now
- Google Videos
- YouTube Search
- Search Actions
- Amazon Search
- Baidu Search
- Bing Images
- Bing Search
- DuckDuckGo Search
- eBay Search
- Facebook Profile
- Google AI Mode
- Google AI Overview
- Google Autocomplete
- Google Finance
- Google Flights
- Google Hotels
- Google Images
- Google Images Light
- Google Immersive Product
- Google Jobs
- Google Lens
- Google Light
- Google Local
- Google Maps
- Google Maps Directions
- Google Maps Reviews
- Google News
- Google News Light
- Google Play Games
- Google Play Product
- Google Play Store
- Google Product
- Google Scholar
- Google Search
- Google Shopping
- Google Trends
- Google Trends Trending Now
- Google Videos
- YouTube Search
Overview
This node provides access to Google Maps Directions data via the SerpApi service. It allows users to request detailed directions between a starting point and an ending point using various input formats such as addresses, place data IDs, or GPS coordinates. The node supports specifying travel modes (e.g., driving, walking, transit), language, country context, and other advanced routing options.
Common scenarios where this node is beneficial include:
- Automating route planning for logistics or delivery services.
- Integrating real-time directions into workflows for travel or event planning.
- Enhancing applications with multi-modal transportation options and preferences.
- Customizing direction queries with avoidance of highways, tolls, or ferries.
Practical example:
- A user wants to get driving directions from "1600 Amphitheatre Parkway, Mountain View, CA" to "1 Infinite Loop, Cupertino, CA" in kilometers, avoiding toll roads, and receiving results in Spanish. This node can be configured with those parameters to fetch the appropriate directions data.
Properties
| Name | Meaning |
|---|---|
| Starting Point Address (start_addr) | Address string defining the start location for directions. Alternative inputs: start_data_id or start_coords. |
| Ending Point Address (end_addr) | Address string defining the end location for directions. Alternative inputs: end_data_id or end_coords. |
| Country (gl) | Country code to localize the search (e.g., "us" for United States). Many country codes supported. Default is "us". |
| Language (hl) | Language code for the response (e.g., "en" for English). Many languages supported. Default is "en". |
| Travel Mode (travel_mode) | Mode of travel for directions. Options: Best (default), Driving, Two-wheeler, Transit, Walking, Cycling, Flight. |
| Starting Point Data ID (start_data_id) | Place data ID for the start location, obtained from Google Maps API. Alternative inputs: start_addr or start_coords. |
| Ending Point Data ID (end_data_id) | Place data ID for the end location, obtained from Google Maps API. Alternative inputs: end_addr or end_coords. |
| Starting Point GPS Coordinates (start_coords) | Latitude and longitude of the start location in "lat,lng" format. Alternative inputs: start_addr or start_data_id. |
| Ending Point GPS Coordinates (end_coords) | Latitude and longitude of the end location in "lat,lng" format. Alternative inputs: end_addr or end_data_id. |
| Distance Unit (distance_unit) | Unit for displayed distances. Options: miles (default), km. |
| Avoid Options (avoid) | Comma-separated list of features to avoid in route: highways, tolls, ferries. |
| Preferred Transit Options (prefer) | Comma-separated preferred transit types when travel mode is Transit: bus, subway, train, tram_light_rail. |
| Route Options (route) | Route preference options: Fewer transfers, Less walking, Wheelchair accessible. |
| Travel Time (time) | Specifies the time to travel; see SerpApi docs for advanced usage. |
| Disable Caching (no_cache) | Boolean to force fresh results ignoring cache. Default false. Cannot be used with async. |
| Async (async) | Boolean to perform asynchronous search submission. Default false. Requires separate retrieval of results later. Cannot be used with no_cache or on accounts with Ludicrous Speed enabled. |
| ZeroTrace Mode (zero_trace) | Enterprise-only boolean to disable storing search metadata on SerpApi servers. Default false. |
| Output (output) | Format of output: JSON (default) for structured data, or html for raw HTML. |
| JSON Restrictor (json_restrictor) | Restricts fields returned in JSON response, e.g., "organic_results[0:3].{title,snippet}". |
Output
The node outputs a JSON object containing the directions data retrieved from SerpApi's Google Maps Directions API. The structure includes detailed route information such as steps, distance, duration, travel mode, and any transit details if applicable.
If the output property is set to "html", the node returns the raw HTML content of the directions page instead of structured JSON.
No binary data output is produced by this node.
Dependencies
- Requires an active SerpApi account with a valid API key credential configured in n8n.
- Internet access to call SerpApi endpoints.
- No additional external dependencies beyond the SerpApi service.
Troubleshooting
- Missing or invalid API key: Ensure the API key credential is correctly set up and has permissions for Google Maps Directions API.
- Invalid or incomplete start/end location inputs: Provide at least one form of start and end location (address, data ID, or coordinates). Missing these will cause errors.
- Conflicting parameters: Avoid using
no_cacheandasynctogether as they are mutually exclusive. - Unsupported travel mode or options: Verify that travel mode and related options are valid and compatible (e.g., preferred transit options only apply if travel mode is Transit).
- Rate limits or quota exceeded: Monitor your SerpApi usage to avoid hitting limits which may result in errors or empty responses.
- Language or country code issues: Use supported ISO codes for language and country parameters to ensure proper localization.