**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google
> Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt). In addition, certain content from the Map Tiles API will no longer be returned. [Learn more](https://developers.google.com/maps/comms/eea/map-tiles.md.txt).

A session token is a piece of data (a
[UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier))
that is used in REST calls to identify a
[session](https://en.wikipedia.org/wiki/Session_(computer_science))---a
series of related message exchanges. You must include a session token in all
requests for 2D Tiles and Street View imagery.
You include it as the value of a `session` parameter appended to all request
URLs.

In the Map Tiles API, a session token represents a defined set of
display options. It means you don't have to pass a set of display options with
each tile request. You can use the same session token across multiple clients.
A session token is currently valid for two weeks from its
issue time, but this might change. You can always check the expiration time of a
session token by looking at the `expiry` field in the response message.

> [!NOTE]
> **Note:** You need to use session tokens for getting 2D Tiles and Street View Tiles, but not for getting 3D Tiles.

## Session token request

To request a session token, send an HTTPS POST request to the `createSession`
endpoint, as shown in the following example. You must send the request with a
`Content-Type: application/json` header.

```json
curl -X POST -d '{
  "mapType": "streetview",
  "language": "en-US",
  "region": "US"
}' \
-H 'Content-Type: application/json' \
"https://tile.googleapis.com/v1/createSession?key=YOUR_API_KEY"
```

### Required fields

`mapType`

:   The type of base map. This value can be one of the following:

    `roadmap`
    :   The standard Google Maps painted map tiles.

    `satellite`
    :   Satellite imagery.

    `terrain`
    :   Terrain imagery. When selecting `terrain` as the map type, you must also
        include the `layerRoadmap` layer type (described in the
        [Optional fields](https://developers.google.com/maps/documentation/tile/session_tokens.md.txt#optional_fields)
        section).

    `streetview`
    :   Street View panoramas. For more information, see
        [Street View Tiles](https://developers.google.com/maps/documentation/tile/streetview.md.txt).

`language`

:   An
    [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag)
    that specifies the language used to display information on the tiles. For
    example, `en-US` specifies the English language as spoken in the United States.

`region`

:   A
    [Common Locale Data Repository](https://cldr.unicode.org/)
    region identifier (two uppercase letters) that represents the physical location
    of the user. For example, `US`.

### Optional fields

`imageFormat`
:   Specifies the file format to return. Valid values are either `jpeg` or `png`.
    JPEG files don't support transparency, therefore they aren't recommended for
    overlay tiles. If you don't specify an `imageFormat`, then the best format for
    the tile is chosen automatically.

`scale`

:   Scales-up the size of map elements (such as road labels), while retaining the
    tile size and coverage area of the default tile. Increasing the scale also
    reduces the number of labels on the map, which reduces clutter. The following
    values are valid `scale` values:

    - `scaleFactor1x`: The default.
    - `scaleFactor2x`: Doubles label size and removes minor feature labels.
    - `scaleFactor4x`: Quadruples label size and removes minor feature labels.

The following examples demonstrate the effect of scaling map elements.

| Scale Factor 1x | Scale Factor 2x |
|---|---|
| ![Map showing scale factor 1x](https://developers.google.com/static/maps/documentation/tile/images/scale1x.png) | ![Map showing scale factor 2x](https://developers.google.com/static/maps/documentation/tile/images/scale2x.png) |

`highDpi`
:   Specifies whether to return high-resolution tiles. If the scale-factor is
    increased, `highDpi` is used to increase the size of the tile. Normally,
    increasing the scale factor enlarges the resulting tile into an image of the
    same size, which lowers quality. With `highDpi`, the resulting size is also
    increased, preserving quality. DPI stands for Dots per Inch, and High DPI means
    the tile renders using more dots per inch than normal. If `true`, then the
    number of pixels in each of the x and y dimensions is multiplied by the scale
    factor (that is , 2x or 4x). The coverage area of the tile remains unchanged.
    This parameter works only with `scale` values of 2x or 4x. It has no effect on
    1x scale tiles.

| Scale Factor 1x | Scale Factor 2x High DPI |
|---|---|
| ![Map displayed at regular resolution](https://developers.google.com/static/maps/documentation/tile/images/scale1x.png) | ![Map displayed at 2x High DPI resolution](https://developers.google.com/static/maps/documentation/tile/images/scale2xhighDPI.png) |

`layerTypes`

:   An array of values that specifies the layer types added to the map. Valid
    values are:

    `layerRoadmap`
    :   Required if you specify `terrain` as the map type. Can also be optionally
        overlaid on the `satellite` map type. Has no effect on roadmap tiles.

    `layerStreetview`
    :   Shows Street View-enabled streets and locations using blue outlines on the
        map.

    `layerTraffic`
    :   Displays current traffic conditions.

`styles`

:   An array of JSON style objects that specify the appearance and detail level of
    map features such as roads, parks, and built-up areas. Styling is used to
    customize the standard Google base map. The `styles` parameter is valid only if
    the map type is `roadmap`. For the complete style syntax, see the
    [Style Reference](https://developers.google.com/maps/documentation/tile/style-reference.md.txt).

`overlay`

:   A boolean value that specifies whether `layerTypes` should be
    rendered as a separate overlay, or combined with the base imagery. When
    `true`, the base map isn't displayed. If you haven't defined any `layerTypes`,
    then this value is ignored.

For example, requesting a `satellite` map type with a `layerRoadmap` layer, and
`overlay` set to `false` results in tiles equivalent to the `hybrid` map type
used in the Maps JavaScript API (left image). The same
map and layer types with `overlay` set to `true` results in a transparent tile
with a map overlay, styled appropriately for overlaying over satellite imagery
(right image).

| `overlay`: false | `overlay`: true |
|---|---|
| ![Overlay set to false](https://developers.google.com/static/maps/documentation/tile/images/overlay-false.jpeg) | ![Overlay set to true](https://developers.google.com/static/maps/documentation/tile/images/overlay-true.png) |

The following JSON is an example of a typical request body that contains both
required and optional fields.

```json
{
  "mapType": "satellite",
  "language": "en-US",
  "region": "us",
  "layerTypes": [ "layerRoadmap", "layerStreetview" ],
  "overlay":  true,
  "scale": "scaleFactor1x",
  "styles": [
    {
      "stylers": [
        { "hue": "#00ffe6" },
        { "saturation": -20 }
      ]
    },{
      "featureType": "road",
      "elementType": "geometry",
      "stylers": [
        { "lightness": 100 },
        { "visibility": "simplified" }
      ]
    }
  ]
}
```

This example provides an overlay that's suitable for combining with satellite
imagery. The example contains both a roadmap and street view overlay. The
resulting map is rendered with names and data in the English language, as it's
spoken in the United States.

## Session token response

The following JSON is an example response body.

```json
{
  "session": "IgAAAHGU9jnAU4KOAfwY3Bcd6eH_WxQsyocSBAdUnAr9pnvTTNXtF9c_27RBo94ytEXTDg",
  "expiry": "1361828036",
  "tileWidth": 256,
  "tileHeight": 256,
  "imageFormat": "png"
}
```

The following list contains definitions of the fields in the response body.

`session`
:   A session token value that you must include in all of your Map Tiles API
    requests.

`expiry`
:   A string that contains the time (in seconds since the epoch) at which the token
    expires. A session token is valid for two weeks from its creation
    time, but this policy might change without notice.

`tileWidth`
:   The width of the tiles measured in pixels.

`tileHeight`
:   The height of the tiles measured in pixels.

`imageFormat`
:   The image format, which can be either `png` or `jpeg`.