Isoline API

Isoline API calculates the areas that you can reach from a location. In other words, the API tells you how far you can go from a place to help you find new locations and businesses opportunities.

With the Isoline API, you can calculate:

  • Isochrones - isolines representing area reachable within given travel time;
  • Isodistances - isolines representing area reachable within given travel distance;

Check out the API Playground to create isochrones and isodistances:

Isochrone API and Isodistance API Live Demo



Authenfication and API key

To use the Isoline API, you'll need an API key. You can register and get a Isoline API Key for free without a credit card.

We offer a free plan, so there's no need to stress about cost. Start for free and upgrade to a paid plan when the needs of your project increase. For more information on our plans, visit the Pricing page.

How to get Geoapify API key

  1. Register on Geoapify MyProjects page
  2. Create a new project.
  3. Go to the API Keys section. One API key is generated automatically. You can generate multiple API keys per project if required.
  4. Optionally, you can protect the API key by listing allowed IP addresses, HTTP referrers, origins, and CORS.
  5. Choose "Isoline API" and an API key to generate a URL and programming code.
  6. Press the "Try" button to execute the API call and get the result object example.

API reference

The Isoline API, available via HTTP Get request, is used to get single or multi-value isolines.

Request URL


https://api.geoapify.com/v1/isoline?Params


Request parameters

Name Description
apiKey Required parameter for API key
lat Latitude of the location
lon Longitude of the location
type Type of isoline: isochrone or isodistance. Possible values: "time", "distance".
mode Transportation or travel mode. Possible values: "drive", "truck", "transit", "approximated_transit", "walk", "bicycle"
range Isoline range value or array of range values. For an isochrone time in seconds, for an isodistance distance in meters
id id of previously generated isoline

Response HTTP status codes

Name Description
200 OK - response contains valid GeoJSON for the requested isoline(s)
202 Accepted - request is in processing. Is returned when big range value (more than 1 hour / 10 km) or multiple range values are set. Response properties contain a "id", GeoJSON can be queried later, once calculation is complete
400 Invalid Request - missing or malformed parameters or combination of parameters
401 Not Authorized - apiKey is missing, invalid, unknown or usage_quota has been reached
503 Service Unavailable - in case of server error or calculation failure

NOTE Isoline calculations are computationally expensive and can take multiple seconds. If calculation takes more than 30 seconds, Isoline API may return HTTP 202 with an empty FeatureColleciton, containing only the request ID. You can then use it to query isolines by ID later - up to one hour from the initial request.

Response Object

  • If the calculation was successful and HTTP status returned is 200, the response object contains GeoJSON FeatureCollection object.
  • If HTTP status returned is 202, only properties object with "id" will be returned.
  • If HTTP status returned is 400 or 401, only error object will be returned.
Name Description
type "FeatureCollection"
features Contains Feature objects of type "Multipolygon". One feature per one range value
properties Contains id, which could be used to query the isoline later
error Error object, contaning error description and details

Request URL examples

Build a single isoline

A typical request for isochrone data looks like this:

https://api.geoapify.com/v1/isoline?type=time&mode=drive&range=2700&lat=48.36172402219373&lon=10.91992098424234&apiKey=YOUR_API_KEY

Isoline API supports the following parameters:

  • lat, lon - latitude and longitude of the location;
  • type - possible values: "time" (isochrone), "distance" (isodistance);
  • mode - transportation or travel mode. Supported values: "drive", "transit", "approximated_transit", "walk", "bicycle";
  • range - defines travel time in seconds for isochrones, and travel distance in meters for isodistances.

and returns GeoJSON, with a unique request ID in the FeatureCollection "properties" object, and each isoline contour is represented by an individual GeoJSON Feature.

Build a multi-range isoline

It is possible to calculate multiple isoline contours at once, with up to 10 different range values. To achieve this, you just need to specify the "range" parameter multiple times.

Example API call that returns 15 and 30-minute isochrones for a given location:

https://api.geoapify.com/v1/isoline?type=time&mode=drive&range=900&range=1800&lat=48.36172402219373&lon=10.91992098424234&apiKey=YOUR_API_KEY

Get an existing isoline

It's possible to retrieve results of earlier Isoline API requests for up to one hour from the time of the initial request. This could be done with an HTTP request with id parameter:

https://api.geoapify.com/v1/isoline?id=ISOLINE_OR_REQUEST_ID&apiKey=YOUR_API_KEY

The value for the id parameter could be an id of FeatureCollection or Feature returned with a regular Isoline API.

Code samples

Geoapify returns data in GeoJSON format, which could be easily drawn by most of map client libraries. The examples below show how to add a GeoJSON object to a map.

Visualize isoline with "Leaflet" library

L.geoJSON(data, {
    style: function (feature) {
        // add layer style here
        return {color: '#222222'};
    }
}).addTo(map);

Visualize isoline with MapLibre GL / Mapbox GL library


this.map.addSource('isoline-data-source', {
  type: "geojson",
  data: isolineGeoJSON,
});

this.map.addLayer({
  id: 'isoline-line',
  type: "line",
  source: 'isoline-data-source',
  paint: {
    "line-color": '#6666ff',
    "line-width": 2,
  },
});

this.map.addLayer({
  id: this.isolineLayerName,
  type: "fill",
  source: 'isoline-fill',
  paint: {
    "fill-color": '#6666ff',
    "fill-opacity": 0.3,
  },
});

Visualize isoline with "OpenLayers" library

var vectorSource = new ol.source.Vector({
    features: (new ol.format.GeoJSON({
        featureProjection: "EPSG:3857"
    })).readFeatures(data)
});

var style = new ol.style.Style({
    stroke: new ol.style.Stroke({
        color: 'rgba(0, 0, 255, 1.0)',
        width: 3
    }),
    fill: new ol.style.Fill({
        color: 'rgba(0, 0, 255, 0.1)'
    })
});

var vectorLayer = new ol.layer.Vector({
    source: vectorSource,
    style: style
});

map.addLayer(vectorLayer);

Pricing

To calculate the cost of each Geoapify request, we use credits. This helps us simplify our Pricing and standardize API calls.

The following rules determine how much a Isoline API request costs:

API name Definition of 1 request Example
Isochrone (Isoline API with type="time") Every 5 requested minutes cost 1 credit 30-minutes isochrone costs 6 credits
Isodistance (Isoline API with type="distance") Every 5 requested km cost 1 credit 25-km isodistance costs 5 credits

Our FREE pricing plan includes 3000 credits per day. Start with the FREE plan and upgrade later, if needed! In addition, we allow you to cache/store calculated isolines on your side with no restrictions.