Roads
England
Wales
Scotland
gethttps://crystalroof.co.uk/customer-api/transport/closest-roads/v1/{location}
Description
This method returns the closest roads.
UK roads fall into the following categories:
- A roads – major roads intended to provide large-scale transport links within or between areas.
- B roads – roads intended to connect different areas, and to feed traffic between A roads and smaller roads on the network.
- Motorways - a high-capacity road with multiple lanes in each direction, controlled access points, and a separation between opposing flows of traffic, typically identified by the letter "M" followed by a number (e.g., M1, M25).
- Classified unnumbered – smaller roads intended to connect together unclassified roads with A and B roads, and often linking a housing estate or a village to the rest of the network. Similar to ‘minor roads’ on an Ordnance Survey map and sometimes known unofficially as C roads.
- Unclassified – local roads intended for local traffic. The vast majority (60%) of roads in the UK fall within this category.
Possible values of the formOfWay field:
- Collapsed Dual Carriageway
- Dual Carriageway
- Guided Busway
- Roundabout
- Shared Use Carriageway
- Single Carriageway
- Slip Road
Possible values of the structure field:
- Road In Tunnel
- null
Possible values of the function field:
- A Road
- B Road
- Local Access Road
- Local Road
- Minor Road
- Motorway
- Restricted Local Access Road
- Secondary Access Road
Parameters
Name | Description |
---|---|
location path string | Postcode, coordinates in the lat,long format or UPRN in the uprn12345678 format. Postcode with or without space. This argument is case-insensitive. |
api_key query enum | Your API key.
|
Request URL:
https://crystalroof.co.uk/customer-api/transport/closest-roads/v1/W60WW?api_key=DEMO
Possible responses with examples
Code
Description
200
Success
{
"data": {
"aRoad": {
"name": "Goldhawk Road",
"roadNumber": "A402",
"class": "A Road",
"function": "A Road",
"formOfWay": "Single Carriageway",
"structure": null,
"primary": false,
"loop": false,
"trunkRoad": false,
"distance": 100.2,
"latitude": 51.496592,
"longitude": -0.24422
},
"bRoad": {
"name": "Stamford Brook Road",
"roadNumber": "B409",
"class": "B Road",
"function": "B Road",
"formOfWay": "Single Carriageway",
"structure": null,
"primary": false,
"loop": false,
"trunkRoad": false,
"distance": 288.6,
"latitude": 51.498675,
"longitude": -0.243484
},
"classifiedUnnumbered": {
"name": "Emlyn Road",
"roadNumber": null,
"class": "Classified Unnumbered",
"function": "Local Road",
"formOfWay": "Single Carriageway",
"structure": null,
"primary": false,
"loop": false,
"trunkRoad": false,
"distance": 394,
"latitude": 51.497364,
"longitude": -0.248223
},
"motorway": {
"name": null,
"roadNumber": "M4",
"class": "Motorway",
"function": "Motorway",
"formOfWay": "Collapsed Dual Carriageway",
"structure": null,
"primary": true,
"loop": false,
"trunkRoad": true,
"distance": 2546.8,
"latitude": 51.489694,
"longitude": -0.278124
},
"unclassified": {
"name": "Invermead Close",
"roadNumber": null,
"class": "Not Classified",
"function": "Local Road",
"formOfWay": "Single Carriageway",
"structure": null,
"primary": false,
"loop": false,
"trunkRoad": false,
"distance": 36.6,
"latitude": 51.496231,
"longitude": -0.243408
}
},
"dataDate": "2023-10-02",
"refreshedDate": "2024-01-26"
}
401
Unauthorized
{
"error": "No such API key or it is not valid anymore."
}
402
Payment Required
{
"error": "You have exhausted the available calls provided by your package."
}
403
Forbidden
{
"error": "API key is invalid for the given action."
}
404
Not Found
{
"error": "Can't find such location."
}
429
Too Many Requests
{
"error": "Too many requests have been sent in one second."
}
500
Internal Server Error
{
"error": "We have already started working on a resolution!"
}