# Google Maps

> Get directions between places and look up place details with Google Maps.

App · Travel & Places · 2 actions. Web page: https://docs.lodol.com/docs/integrations/google-maps

## Actions

### Get directions

Get directions between two places. Give a start and end point as an address, a place name, or 'latitude,longitude', and get back the distance, travel time, and turn-by-turn steps for the best route. Choose a travel mode and, for driving, whether to avoid tolls, highways, or ferries.

**Inputs**

- Start (`origin`, text, required): Where the route starts. An address, a place name, a plus code, or 'latitude,longitude', for example "1600 Amphitheatre Parkway, Mountain View, CA" or "37.4224,-122.0842".
- End (`destination`, text, required): Where the route ends. An address, a place name, a plus code, or 'latitude,longitude'.
- Travel mode (`travel_mode`, text): How the trip is made. One of: `DRIVE` (Driving), `WALK` (Walking), `BICYCLE` (Bicycling), `TWO_WHEELER` (Two-wheeler (motorcycle)), `TRANSIT` (Public transit). Default: `DRIVE`.
- Avoid tolls (`avoid_tolls`, true/false): Avoid toll roads. Applies to Driving and Two-wheeler routes only. Default: `false`.
- Avoid highways (`avoid_highways`, true/false): Avoid highways. Applies to Driving and Two-wheeler routes only. Default: `false`.
- Avoid ferries (`avoid_ferries`, true/false): Avoid ferries. Applies to Driving and Two-wheeler routes only. Default: `false`.
- Units (`units`, text): Unit system for the distance and duration text in the result. One of: `METRIC` (Metric (km)), `IMPERIAL` (Imperial (miles)). Default: `METRIC`.

**Outputs**

- `distance_meters` (number): Total route distance in meters.
- `distance_text` (text): Human-readable distance, for example '15.2 km'.
- `duration_seconds` (number): Estimated travel time in seconds.
- `duration_text` (text): Human-readable travel time, for example '22 mins'.
- `found` (true/false): Whether a route was found.
- `polyline` (text): Encoded polyline for the route geometry.
- `steps` (list): Turn-by-turn steps for the route.
- `warnings` (list): Advisory warnings returned for the route.

**Example output**

```json
{
  "distance_meters": 51234,
  "distance_text": "51.2 km",
  "duration_seconds": 2460,
  "duration_text": "41 mins",
  "found": true,
  "polyline": "ipkcFfichVnP@j@BLoFVwM{E?",
  "steps": [
    {
      "distance": "0.2 km",
      "instruction": "Head north on Amphitheatre Pkwy"
    },
    {
      "distance": "48 km",
      "instruction": "Turn right onto US-101 N"
    }
  ],
  "warnings": []
}
```

### Get place details

Get details about a place from its Google Place ID: name, address, coordinates, phone number, website, rating, opening hours, and more. Get a Place ID from Google's Place ID Finder or from another Maps action that returns one.

**Inputs**

- Place ID (`place_id`, text, required): The Google Place ID, for example "ChIJj61dQgK6j4AR4GeTYWZsKWw". The "places/" prefix is optional. Find one with Google's Place ID Finder: https://developers.google.com/maps/documentation/places/web-service/place-id.
- Language (`language_code`, text): Optional. Language for the results as a BCP-47 code, for example "en" or "fr".
- Region (`region_code`, text): Optional. Region bias as a two-letter CLDR/ISO country code, for example "US" or "GB". Affects address formatting.

**Outputs**

- `business_status` (text): Business status, for example 'OPERATIONAL'.
- `editorial_summary` (text): A short editorial description of the place.
- `formatted_address` (text): The full formatted address.
- `found` (true/false): Whether the place was found.
- `google_maps_uri` (text): Link to the place on Google Maps.
- `latitude` (number): Latitude of the place.
- `longitude` (number): Longitude of the place.
- `name` (text): The place's display name.
- `national_phone_number` (text): National-format phone number.
- `open_now` (true/false): Whether the place is open right now.
- `opening_hours` (list): Human-readable opening hours, one line per day.
- `phone_number` (text): International phone number.
- `place_id` (text): The place's Google Place ID.
- `price_level` (text): Price level, for example 'PRICE_LEVEL_MODERATE'.
- `rating` (number): Average user rating (1.0–5.0).
- `types` (list): Place type tags, for example 'restaurant'.
- `user_rating_count` (number): Number of user ratings.
- `website` (text): The place's website URL.

**Example output**

```json
{
  "business_status": "OPERATIONAL",
  "editorial_summary": "Google's headquarters in Mountain View, California.",
  "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
  "found": true,
  "google_maps_uri": "https://maps.google.com/?cid=10281119596374313554",
  "latitude": 37.4224764,
  "longitude": -122.0842499,
  "name": "Googleplex",
  "national_phone_number": "(650) 253-0000",
  "open_now": true,
  "opening_hours": [
    "Monday: 9:00 AM \u2013 5:00 PM",
    "Tuesday: 9:00 AM \u2013 5:00 PM"
  ],
  "phone_number": "+1 650-253-0000",
  "place_id": "ChIJj61dQgK6j4AR4GeTYWZsKWw",
  "price_level": "",
  "rating": 4.6,
  "types": [
    "corporate_office",
    "point_of_interest",
    "establishment"
  ],
  "user_rating_count": 2847,
  "website": "https://about.google/"
}
```
