Donate using PayPal

CycleStreets API (v2)

  • Details for:
  • API overview
  • Obtain API key
  • Usage policy
  • Uptime policy

Infrastructure locations

This call retrieves information in an infrastructure dataset.

Data returned is licensed as per the respective owners.

The TfL Cycling Infrastructure Database map is an example use of this API call.

Data is currently limited to a maximum of 5,000 locations per request. Given the high volume of data for some datasets, application developers are strongly recommended to enforce a high zoom level in their user interface to avoid poor browser performance.

Example

Example which retrieves infrastructure locations data.

https://api.cyclestreets.net/v2/infrastructure.locations?dataset=tflcid&type=cycle_parking&bbox=-0.119307,51.509784,-0.117435,51.509995

Result:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {
                "_type": "cycle_parking",
                "type": "sheffield",
                "capacity": 2,
                "osm_id": 476102903,
                "images": [],
                "iconUrl": "https://www.example.com/images/icons/point.svg"
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -0.118422,
                    51.509905
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
		"_type": "cycle_parking",
                "type": "box",
                "capacity": 4,
                "osm_id": 476102903,
                "images": [],
                "iconUrl": "https://www.example.com/images/icons/point.svg"
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -0.118374,
                    51.509920
                ]
            }
        }
    ]
}

Request parameters - required

dataset string
Dataset name.
Currently-supported public values are: tflcid.
bbox comma separated bounds: west,south,east,north
Boundaries of a region in degrees longitude / latitude. (This is a required parameter, except in review/approved modes, noted below.)

Request parameters - optional

type string
Infrastructure type (category).
latest 1|0, default 0
Whether to obtain the latest revision (arising from crowdsourced updates) of each location, rather than the original published data. This will also add an additional key 'status' into the result data.
simplify 1|0, default 0
Whether to apply line simplification to the line, to reduce data volume, using the Douglas-Peucker algorithm.
field:<fieldname> string/number

Filter to fields in the data, e.g. field:cycle_parking=box would add this as a search constraint. This is useful for advanced search interfaces.

If values are comma-separated, they will be treated as an OR list, e.g. field:severity=slight,serious would match records with a property 'severity' whose value is either 'slight' or 'serious'.

Fieldnames match those shown in the infrastructure.schema API call output.

review 1|0, default 0
Enables review mode, which outputs only locations arising from crowdsourced updates awaiting review. In this mode, bbox is not required, as this would not normally be wanted, but using it will filter results to the area specified.
approved 1|0, default 0
Enables approved mode, which outputs only locations approved from crowdsourced updates having had review (moderation). In this mode, bbox is not required, as this would not normally be wanted, but using it will filter results to the area specified.
format string, default geojson

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:

  • geojson: GeoJSON output (see example) (default)
  • csv: CSV text. If set to this, the specified fields order will be respected.

Response

JSON structure as per example above.

Error response

JSON object containing an error key and a text string.

Example error (text string may vary):

{
    "error": "No bbox parameter was supplied."
}

We welcome your feedback, especially to report bugs or give us route feedback.

My comments relate to: *






Your comments: *
URL of page: * https://portsmouth.cyclestreets.net/api/v2/infrastructure.locations/
How did you find out about CycleStreets?:
Your name:
Our ref: Please leave blank - anti-spam measure

* Items marked with an asterisk [*] are required fields and must be fully completed.