# Google Maps Platform

> Places, geocoding, directions, distance matrix, elevation and time zone from Google Maps Platform.

Lets an agent search places, geocode addresses, compute routes and look up
elevation and time zones using the Google Maps Platform web services.

## What it can do

| Method | What it does |
| --- | --- |
| `googlemaps_text_search` | Text search for places (e.g. "pizza in New York") with optional location/radius bias, type and price filters. |
| `googlemaps_nearby_search` | Find places around a point by radius (or rank by distance), filtered by keyword/type/price. |
| `googlemaps_place_details` | Get full details for one place by place_id (hours, phone, rating, website, ...). |
| `googlemaps_place_autocomplete` | Autocomplete place predictions as a user types, with optional bias and component filters. |
| `googlemaps_geocode` | Forward geocode an address (or component filter) to coordinates and place_id. |
| `googlemaps_reverse_geocode` | Reverse geocode coordinates to addresses. |
| `googlemaps_directions` | Get directions between two points with mode, waypoints, traffic and transit options. |
| `googlemaps_distance_matrix` | Travel distance and time for a matrix of origins x destinations. |
| `googlemaps_elevation` | Get elevation for discrete points or sampled along a path. |
| `googlemaps_time_zone` | Get the time zone (id, name, UTC/DST offset) for a location at a given time. |

## How to get credentials

1. Open [the Google Maps Platform credentials page](https://console.cloud.google.com/google/maps-apis/credentials).
2. Select (or create) a project and make sure billing is enabled for it.
3. Click **Create credentials -> API key** and copy the key.
4. Enable the APIs you plan to use (Places API, Geocoding API, Directions API,
   Distance Matrix API, Elevation API, Time Zone API) under **APIs & Services**.
5. Recommended: restrict the key to those APIs to limit exposure.

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `GOOGLEMAPS_API_KEY` | Google Cloud console -> Google Maps Platform -> Credentials -> API key |

## Links

- [Create an API key](https://console.cloud.google.com/google/maps-apis/credentials)
- [Google Maps Platform docs](https://developers.google.com/maps/documentation)
