Skip to content

EU Endpoints

Our commitment to privacy begins in our earliest days as a company, and we take extreme care to run all of our services with a focus on ensuring the privacy of our customers and users. While we are confident that our privacy practices and procedures satisfy GDPR requirements by default, we recognize that some customers prefer to guarantee that user requests and personally identifiable information (PII) remain within the European Union.

To accommodate this preference, we publish EU-only endpoints. These endpoints ensure users exclusively connect to EU-based servers. Our systems scrub PII at the network's edge; consequently, any requests processed by our internal services in other regions are managed in a completely private manner.

Using the EU Endpoints

Info

By utilizing EU endpoints, you will establish connections exclusively with two of our servers strategically positioned in the European Union: Frankfurt, Germany and Paris, France.

To use the EU endpoints, substitute the endpoints in our documentation as shown below.

Map Endpoints

For map tiles and services, replace:

https://tiles.stadiamaps.com
with

https://tiles-eu.stadiamaps.com
Example: Using EU Endpoints for MapLibre & Alidade Smooth
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Vector Map Demo</title>
        <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
        <script type="text/javascript" src="//unpkg.com/maplibre-gl@4.0.2/dist/maplibre-gl.js"></script>
        <link href="//unpkg.com/maplibre-gl@4.0.2/dist/maplibre-gl.css" rel="stylesheet" />
        <style type="text/css">
            body {
              margin: 0;
              padding: 0;
            }

            #map {
              position: absolute;
              top: 0;
              bottom: 0;
              width: 100%;
            }
        </style>
    </head>
    <body>
        <div id="map"></div>
        <script type="text/javascript">
         var map = new maplibregl.Map({
           container: 'map',
           style: 'https://tiles-eu.stadiamaps.com/styles/alidade_smooth.json',  // (1)!
           center: [12, 53],  // Initial focus coordinate
           zoom: 4
         });

         // MapLibre GL JS does not handle RTL text by default,
         // so we recommend adding this dependency to fully support RTL rendering if your style includes RTL text
         maplibregl.setRTLTextPlugin('https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js');

         // Add zoom and rotation controls to the map.
         map.addControl(new maplibregl.NavigationControl());
        </script>
    </body>
</html>
  1. This line is the key change; note the tiles-eu host.

API Endpoints

For routing, geocoding, time zone, and other services, replace:

https://api.stadiamaps.com
with

https://api-eu.stadiamaps.com

Example Code

Here are some code examples of using the EU endpoints with our official SDKs and cURL.

Installation Instructions

The Stadia Maps JavaScript/TypeScript SDK is available for any package manager that supports the npm registry.

NPM Downloads

npm install @stadiamaps/api
yarn add @stadiamaps/api
bun add @stadiamaps/api
import { GeospatialApi, Configuration{{ extra_js_imports }} } from '@stadiamaps/api';

// If you are writing for a backend application or can't use domain-based auth,
// then you'll need to add your API key like so:
//
// const config = new Configuration({ basePath: "https://api-eu.stadiamaps.com", apiKey: "YOUR-API-KEY" }); (1)
const config = new Configuration({ basePath: "https://api-eu.stadiamaps.com" });
const api = new GeospatialApi(config);

const res = await api.tzLookup({ lat: 40.71278, lng: -74.00611 });
  1. Learn how to get an API key in our authentication guide.
Installation Instructions

The Stadia Maps Python SDK is available through any package manager that supports PyPi.

PyPI - Downloads

pip install stadiamaps
poetry add stadiamaps
import os
import stadiamaps
from stadiamaps.rest import ApiException

configuration = stadiamaps.Configuration(host="https://api-eu.stadiamaps.com")

# Configure API key authentication (ex: via environment variable). (1)
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with stadiamaps.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stadiamaps.GeospatialApi(api_client)

    try:
        res = api_instance.tz_lookup(40.71278, -74.00611)
    except ApiException as e:
        # Add your error handling here
        print("Exception when calling the Stadia Maps API: %s\n" % e)
  1. Learn how to get an API key in our authentication guide.
Installation Instructions

Authenticate to GitHub Packages

We host our Maven packages on GitHub Packages. GitHub requires authentication for this, and has a guide on setting this up.

Add the Maven Repository

Next, add the repository to the repositories block in your Gradle build script like so.

build.gradle.kts
repositories {
    mavenCentral()

    maven {
        url = uri("https://maven.pkg.github.com/stadiamaps/stadiamaps-api-kotlin")
        credentials {
            username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
            password = project.findProperty("gpr.token") as String? ?: System.getenv("TOKEN")
        }
    }
}
build.gradle
repositories {
    mavenCentral()

    maven {
        url = uri("https://maven.pkg.github.com/stadiamaps/stadiamaps-api-kotlin")
        credentials {
            username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
            password = project.findProperty("gpr.token") ?: System.getenv("TOKEN")
        }
    }
}

Add Dependencies

Now you're ready to add the package and its dependencies.

build.gradle.kts
dependencies {
    val retrofitVersion = "2.9.0"

    // API package
    implementation("com.stadiamaps:api:1.0.0")

    // Dependencies
    implementation("com.squareup.moshi:moshi-kotlin:1.14.0")
    implementation("com.squareup.moshi:moshi-adapters:1.14.0")
    implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
    implementation("com.squareup.retrofit2:retrofit:$retrofitVersion")
    implementation("com.squareup.retrofit2:converter-moshi:$retrofitVersion")
    implementation("com.squareup.retrofit2:converter-scalars:$retrofitVersion")
}
build.gradle
dependencies {
    def retrofitVersion = "2.9.0"

    // API package
    implementation 'com.stadiamaps:api:3.0.0'

    // Dependencies
    implementation 'com.squareup.moshi:moshi-kotlin:1.15.1'
    implementation 'com.squareup.moshi:moshi-adapters:1.15.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
    implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
    implementation "com.squareup.retrofit2:converter-moshi:${retrofitVersion}"
    implementation "com.squareup.retrofit2:converter-scalars:${retrofitVersion}"
}
// Imports (at the top of your source file; we've used some wildcard imports for simplicity)
import com.stadiamaps.api.apis.*
import com.stadiamaps.api.auth.ApiKeyAuth
import com.stadiamaps.api.infrastructure.*
import com.stadiamaps.api.models.*

// Set your API key (from an environment variable in this case) (1)
val apiKey = System.getenv("STADIA_API_KEY") ?: throw RuntimeException("API Key not set")

val client = ApiClient(baseUrl = "https://api-eu.stadiamaps.com")
client.addAuthorization("ApiKeyAuth", ApiKeyAuth("query", "api_key", apiKey))

// Configure a service for the group of APIs we want to talk to
val service = client.createService(GeospatialApi::class.java)
// Set up the request.
// Note: this code is blocking for demonstration purposes.
// If you're using Kotlin with coroutines,
// you can also use these asynchronously within suspend functions.
// Synchronous code can enqueue a callback to avoid blocking
// (you'll definitely want to do one of these instead when on the main thread of an app).
// See the docs for details: https://square.github.io/retrofit/2.x/retrofit/retrofit2/Call.html
val res = service.tzLookup(40.71278, -74.00611).execute()

if (res.isSuccessful) {
    println("Found result: ${res.body()}")
} else {
    println("Request failed with error code ${res.code()}")
}
  1. Learn how to get an API key in our authentication guide.
Installation Instructions

Our Swift SDK is distributed using the Swift Package Manager (SPM). Apple's documentation shows how to add a Swift Package dependency to your Xcode project. On the Add Package screen, you can find our package by its repository URL: https://github.com/stadiamaps/stadiamaps-api-swift.

import StadiaMaps

// This setup code can go anywhere before you actually make an API call (typically in your app init)
func setupStadiaMapsAPI() {
    // Set your API key (1)
    StadiaMapsAPI.customHeaders = ["Authorization": "Stadia-Auth YOUR-API-KEY"]
    // Configure the client to use our EU endpoint
    StadiaMapsAPI.basePath = "https://api-eu.stadiamaps.com"
}

// This function demonstrates how to call the Stadia Maps API.
// If you have not yet adopted async/await in your Swift codebase, you can use the Task API
// to call async functions in a non-async context: https://developer.apple.com/documentation/swift/task.
func myFunction() async throws {
    let res = try await GeospatialAPI.tzLookup(lat: 40.71278, lng: -74.00611)

    // Do something with the response...
    print(res)
}
  1. Learn how to get an API key in our authentication guide.
Installation Instructions

Composer

To install the package via Composer, add stadiamaps/stadiamaps-api-php to your composer.json:

{
  "require": {
    "stadiamaps/stadiamaps-api-php": "1.*"
  }
}

Then run composer install.

Manual Installation

You can also download the files manually and include autoload.php in your scripts:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
<?php
// use or require, depending on your installation method.

// Configure API key authorization (replace with your Stadia Maps API key) and the EU endpoint (1)
$config = Configuration::getDefaultConfiguration()->setApiKey('api_key', getenv('API_KEY'))->setHost('https://api-eu.stadiamaps.com');

$apiInstance = new OpenAPI\Client\Api\GeocodingApi(
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->tzLookup(40.71278, -74.00611);

    // Do something with the response...
    print_r($result);
} catch (Exception $e) {
    // Add your error handling here
    echo 'Exception when calling the Stadia Maps API: ', $e->getMessage(), PHP_EOL;
}
  1. Learn how to get an API key in our authentication guide.
curl "https://api-eu.stadiamaps.com/tz/lookup/v1?lat=40.71278&lng=-74.00611&api_key=YOUR-API-KEY"