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 integrates with SerpApi's Google Maps Directions API to provide detailed directions between two points. It allows users to specify starting and ending locations using addresses, place data IDs, or GPS coordinates. The node supports various travel modes such as driving, walking, cycling, transit, and flights, and offers options to customize the route by avoiding highways, tolls, or ferries, preferring certain transit types, and selecting route preferences like fewer transfers or wheelchair accessibility.
Common scenarios for this node include:
- Generating step-by-step directions for delivery or logistics applications.
- Planning routes for travel or commuting with specific preferences.
- Integrating real-time routing information into workflows that require location-based decision-making.
Practical example:
- A workflow that takes user input for start and end addresses and returns driving directions in kilometers, avoiding toll roads, and preferring bus transit if applicable.
Properties
| Name | Meaning |
|---|---|
| Starting Point Address (start_addr) | Address of the starting point for the directions search. Alternatively, can use starting point data ID or GPS coordinates. |
| Ending Point Address (end_addr) | Address of the ending point for the directions search. Alternatively, can use ending point data ID or GPS coordinates. |
| Country (gl) | Country code to localize the Google Maps Directions search. Examples: "us" for United States, "gb" for United Kingdom, "fr" for France, etc. Defaults to "us". |
| Language (hl) | Language code for the search results. Examples: "en" for English, "es" for Spanish, "fr" for French, etc. Defaults to "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 starting point, obtained via Google Maps API. Alternative to address or coordinates. |
| Ending Point Data ID (end_data_id) | Place data ID for the ending point, obtained via Google Maps API. Alternative to address or coordinates. |
| Starting Point GPS Coordinates (start_coords) | GPS coordinates (latitude,longitude) for the starting point. Alternative to address or data ID. |
| Ending Point GPS Coordinates (end_coords) | GPS coordinates (latitude,longitude) for the ending point. Alternative to address or data ID. |
| Distance Unit (distance_unit) | Unit for displayed distances. Options: miles or kilometers. Defaults to miles. |
| Avoid Options (avoid) | Comma-separated list of features to avoid on the route. Options include highways, tolls, ferries. |
| Preferred Transit Options (prefer) | Comma-separated list of preferred transit types when travel mode is Transit. Options: bus, subway, train, tram_light_rail. |
| Route Options (route) | Route preference options. Options: Fewer transfers, Less walking, Wheelchair accessible. |
| Travel Time (time) | Specifies the time to travel. Used for advanced scheduling and routing options. See SerpApi docs for details. |
| Disable Caching (no_cache) | Boolean to force fetching fresh results instead of cached ones. Cached results expire after 1 hour. Default is false. |
| Async (async) | Boolean to perform the search asynchronously. If true, results must be retrieved later via Search Archive API. Cannot be used with no_cache. Default is false. |
| ZeroTrace Mode (zero_trace) | Enterprise-only boolean to disable storing search parameters and metadata on SerpApi servers for privacy. Default is false. |
| Output (output) | Format of the output. Options: JSON (structured data, default), or HTML (raw HTML response). |
| JSON Restrictor (json_restrictor) | Restricts fields returned in the JSON response. For example, "organic_results[0:3].{title,snippet}" limits to first 3 organic results with only title and snippet fields. |
Output
The node outputs a JSON object containing the directions data retrieved from SerpApi's Google Maps Directions API. This includes detailed route information such as steps, distances, durations, travel modes, and any additional metadata provided by the API.
If the output format is set to HTML, the raw HTML content of the search result page is returned instead.
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.
- Proper configuration of the API key credential in n8n to authenticate requests.
Troubleshooting
- Missing or invalid API key: Ensure the API key credential is correctly set up and has permissions for Google Maps Directions API usage.
- Invalid or incomplete location inputs: Provide either addresses, data IDs, or GPS coordinates for both start and end points. Missing these will cause errors.
- Conflicting parameters: Avoid using
no_cacheandasynctogether as they are incompatible. - Unsupported travel mode or options: Verify that selected travel modes and route preferences are supported by the API.
- Rate limiting or quota exceeded: Monitor your SerpApi usage to avoid hitting limits which may cause request failures.
- Language or country codes not recognized: Use valid ISO codes as per the property options to prevent unexpected results.