Skip to content






Isochrones show areas of equal travel time from a starting point, letting you quickly get an idea of mobility in an area on a map, or act as input to spatial analysis. Our APIs can compute isochrones for automobile, cycling, and pedestrian use.


Example Code


Get started quickly with code samples using our official SDKs or cURL. Official SDKs include documentation of all request and response models, either as separate pages, or through docstrings and autocomplete in most IDEs. If you are building for another language or want to try out requests in a browser, refer to our interactive API reference.

import { RoutingApi, Configuration, IsochroneRequest } 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({ apiKey: "YOUR-API-KEY" });
// You can also use our EU endpoint to keep traffic within the EU using the basePath option:
// const config = new Configuration({ basePath: "" });
// const api = new RoutingApi(config);
const api = new RoutingApi();

const req: IsochroneRequest = {
    id: "isochrone",
    locations: [
            lat: 59.436884,
            lon: 24.742595
    costing: "pedestrian",
    contours: [
            time: 5,
            color: "aabbcc"
    polygons: true
const res = await api.isochrone({ isochroneRequest: req });
import os
import stadiamaps
from import ApiException

# You can also use our EU endpoint to keep traffic within the EU like so:
# configuration = stadiamaps.Configuration(host="")
configuration = stadiamaps.Configuration()

# Configure API key authentication (ex: via environment variable).
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.RoutingApi(api_client)

        req = stadiamaps.IsochroneRequest(
            locations=[{"lat": 40.042072, "lon": -76.306572}],
                stadiamaps.Contour(time=5, color="aabbcc")

        res = api_instance.isochrone(req)
    except ApiException as e:
        # Add your error handling here
        print("Exception when calling the Stadia Maps API: %s\n" % e)
// 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)
val apiKey = System.getenv("STADIA_API_KEY") ?: throw RuntimeException("API Key not set")

// Defining the host is optional and defaults to
// You can also use our EU endpoint to keep traffic within the EU like so:
// val client = ApiClient(baseUrl = "")
val client = ApiClient()
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(

// Set up the request. Note: if you're using Kotlin with coroutines, you can also await
// rather than executing synchronously when using suspend functions.
val req = IsochroneRequest(
    id = "isochrone",
    locations = listOf(Coordinate(40.042072, -76.306572)),
    costing = IsochroneCostingModel.pedestrian,
    contours = listOf(Contour(time = 5.0, color = "aabbcc")),
    polygons = true,
val res = service.isochrone(req).execute()

if (res.isSuccessful) {
    println("Found result: ${res.body()}")
} else {
    println("Request failed with error code ${res.code()}")
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
    StadiaMapsAPI.customHeaders = ["Authorization": "Stadia-Auth YOUR-API-KEY"]
    // Optionally use our EU endpoint to keep traffic within the EU
    // StadiaMapsAPI.basePath = ""

// 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:
func myFunction() async throws {
    let req = IsochroneRequest(
        id: "isochrone",
        locations: [Coordinate(lat: 40.042072, lon: -76.306572)],
        costing: .pedestrian,
        contours: [Contour(time: 5, color: "aabbcc")],
        polygons: true
    let res = try await RoutingAPI.isochrone(isochroneRequest: req)

    // Do something with the response...
curl -X POST -H "Content-Type: application/json" -d '{
    "id": "isochrone",
    "locations": [
            "lat": 59.436884,
            "lon": 24.742595
    "costing": "pedestrian",
    "contours": [
            "time": 5,
            "color": "aabbcc"
    "polygons": true
}' ""

Next Steps