1. OpenStreetMap API
  2. Extract Features
GET

/v1/osm/extract

tags*
bbox
api_key*

This API extracts features from the OpenStreetMap database and formats them as GeoJSON.

You can filter for any tag in the database, either as key=value or key=*, and can chain tags if you need 2+ tags.

This endpoint is especially useful for extracting map data directly to user applications (like the browser) or as a faster alternative to Overpass Turbo and the Overpass API.

Request Parameters

tagsRequired
string

This is a list of tags in the form key=value to filter features for. All features extracted will satisfy each of the passed tags given by this parameter.

This tag list can be created by forming an array of key=value items and joining them into one string with the & character.

Because both = and & are reserved characters in URIs, this list must be URL encoded.

An example list of tags could be leisure=park and name=Westglen Park. This matches parks that have the name Westglen Park. To set this parameter, we’ll URL encode leisure=park&name=Westglen Park.

Documentation on tags can be found on the TagInfo resource website.

bboxDefault: None
string

This is the bounding box for extracted features. The coordinates (in EPSG:4326) of the bounding box are required to be in (minimum longitude, minimum latitude, maximum longitude, maximum latitude) order. Coordinates are expressed as signed floats joined by commas.

An example bounding box in the US could be -108.984375,32.026706,-103.051758,37.195331.

You can create a bounding box on bboxfinder, or in shapely by invoking the bounds property on a geometry.

api_keyRequired
string

Your account’s API key. You can create an API key by registering for an account and copy and paste it from your account dashboard.

Response

When the OSM feature extract is successfully created, a 200 OK response will be issued, with Content-Type: application/json. The body will be a valid GeoJSON FeatureCollection.

In the event of an error, an error response will be issued, usually with a 5xx error code. The error will be JSON-formatted, with an error field describing the cause.

error
string

The error message if the extract request parameters were incorrectly formatted.

This response field will not be present if the extract succeeds.

Data License

This API serves OpenStreetMap data, which is freely available and is licensed under the Open Data Commons Open Database License (ODbL).