Contents:
This API call enables you to retrieve Points of Interest (POIs) in a geographical area.
You can firstly retrieve the types of POIs available using the pois.types API call.
You can supply either:
This is an interface to the same data used for the Points of interest pages.
There is currently a limitation that only locations defined in the upstream datasource (OpenStreetMap) as point sources are returned. We plan to add in polygon-based original data shortly.
(In these examples, a limit of 3 locations has been set, to avoid a long example on this page, but normally no limit would be set.)
Example 1 (bounding box): Retrieves cycle parking locations within a specified bounding box, also retrieving OSM metadata.
https://api.cyclestreets.net/v2/pois.locations?type=cycleparking&bbox=0.111035,52.201395,0.125325,52.209285&limit=3&fields=id,latitude,longitude,name,osmTags
Example 2 (radius): Retrieves cycle parking locations within a 5km radius of a location in Cambridge, in order of proximity, also retrieving OSM metadata.
https://api.cyclestreets.net/v2/pois.locations?type=cycleparking&longitude=0.11795&latitude=52.20530&radius=5&limit=3&fields=id,latitude,longitude,name,osmTags
Result (same structure from either example):
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "id": "943984", "name": "(Name not known)", "osmTags": { "amenity": "bicycle_parking", "capacity": "76", "covered": "no", "source": "survey" } }, "geometry": { "type": "Point", "coordinates": [ 0.118357, 52.205166 ] } }, { "type": "Feature", "properties": { "id": "907790", "name": "(Name not known)", "osmTags": { "amenity": "bicycle_parking", "capacity": "12", "covered": "no", "source": "survey" } }, "geometry": { "type": "Point", "coordinates": [ 0.118967, 52.205429 ] } }, { "type": "Feature", "properties": { "id": "622058", "name": "(Name not known)", "osmTags": { "amenity": "bicycle_parking", "capacity": "18", "covered": "no", "source": "survey" } }, "geometry": { "type": "Point", "coordinates": [ 0.118907, 52.204823 ] } } ] }
You must also supply either a bounding box or a latitude/longitude/radius combination:
or
It is strongly recommended to specify a fields list, so that clients receive exactly the data they need.
Controls what information is returned for each location. It is strongly recommended to send this, so that clients receive exactly the data they need.
Available fields are:
additionalMetadata[subfield1,subfield2,…]
, the subfields will appear at the top level of the properties instead of wrapped. This latter format is required for CSV (as it ensures a consistent number of fields are outputted).If fields is not supplied, the default is used, which represents a sensible and useful set of fields.
The fields id,latitude,longitude,name are always returned.
The values for latitude,longitude appear only in the /geometry/coordinates field rather than being duplicated in the properties list.
Fields are returned in the ordering specified by the caller.
Unrecognised fieldnames are simply ignored rather than an error being thrown.
Sets the output format. Not normally required except in the use-case of requiring an export. The appropriate HTTP headers will be sent. Available values are:
fields
order will be respected.GeoJSON feature list as per example above.
Features will always be a GeoJSON Point type. We plan to add support for other types (e.g. Polygon) in the future, but such a future feature would only be triggered by a new parameter indicating that it supports polygon types also.
JSON object containing an error key and a text string.
Example error (text string will vary):
{
"error": "Invalid POI type"
}