<br />

To generate an isochrone, send an HTTP POST request to the `generate` endpoint:

    POST https://isochrones.googleapis.com/v1/isochrones:generate

Authenticate your request by passing an API key in the `X-Goog-Api-Key` HTTP
header (recommended) or the `?key=` URL query parameter, or by passing an OAuth
2.0 bearer token in the `Authorization: Bearer` header. You can optionally
include the `X-Goog-FieldMask` header (for example,
`X-Goog-FieldMask: isochrone.geoJson` or `*`); because `isochrone.geoJson` is
the only response field, omitting `X-Goog-FieldMask` returns the full response.

## Example: Standard driving isochrone

The following request generates a five-minute (300 seconds) smoothed driving
isochrone from a location in Seattle, Washington.

    curl -X POST "https://isochrones.googleapis.com/v1/isochrones:generate" \
      -H "X-Goog-Api-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "location": {
          "latitude": 47.6062,
          "longitude": -122.3321
        },
        "travelDuration": "300s",
        "travelMode": "DRIVE",
        "routingPreference": "TRAFFIC_UNAWARE",
        "enableSmoothing": true,
        "travelDirection": "FROM"
      }'

![seattle driving isochrone with smoothing](https://developers.google.com/static/maps/documentation/isochrones/images/isochrone-seattle.png)

## Example: Walking isochrone

This request generates a 30-minute (1,800 second) walking isochrone from a
location near the Colosseum in Rome.

    curl -X POST "https://isochrones.googleapis.com/v1/isochrones:generate?key=YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "location": {
        "latitude": 41.8967068,
        "longitude": 12.4822025
      },
      "travelDuration": "1800s",
      "travelMode": "WALK",
      "routingPreference": "TRAFFIC_UNAWARE",
      "enableSmoothing": true,
      "travelDirection": "FROM"
    }'

![rome walking isochrone without smoothing](https://developers.google.com/static/maps/documentation/isochrones/images/isochrone-rome.png)

## Example: Driving isochrone using a place ID

The following request generates a 30-minute (1,800 seconds) driving isochrone
starting from the Ferry Building in San Francisco.

> [!NOTE]
> **Note:** Use the resource name format (`places/PLACE_ID`) for the `place` field. A bare place ID is also accepted. When a place ID is used, the API resolves the place to its geometric centroid and snaps that point to the nearest road segment usable by the travel mode. Large landmarks, parks, or viewpoints whose centroid is far from such a road (more than about 200 meters, or less for `WALK` and `BICYCLE`) might return `404 NOT_FOUND`; for those locations, specify the road entrance coordinates using `location` instead. For more information about place IDs, see [Place IDs](https://developers.google.com/maps/documentation/places/web-service/place-id).

    curl -X POST "https://isochrones.googleapis.com/v1/isochrones:generate" \
      -H "X-Goog-Api-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "place": "places/ChIJIQBpAG2ahYAR_6128GcTUEo",
        "travelDuration": "1800s",
        "travelMode": "DRIVE",
        "routingPreference": "TRAFFIC_UNAWARE",
        "enableSmoothing": true,
        "travelDirection": "FROM"
      }'

![golden gate driving isochrone](https://developers.google.com/static/maps/documentation/isochrones/images/isochrone-golden-gate.png)