A small proxy API that serves UK public-transport data: NaPTAN stops within a bounding box, GB train station locations, and bus route stop sequences scraped from bustimes.org. All endpoints are GET and require no authentication.
Returns NaPTAN stops inside a bounding box as CSV (header row + matching rows). Provide either a WGS84 lat/lon box or an OSGB36 easting/northing box.
Query parameters
| Name | Type | Notes |
|---|---|---|
minLat, maxLat | number | WGS84 latitude bounds. |
minLon, maxLon | number | WGS84 longitude bounds. |
minEasting, maxEasting | number | OSGB36 easting bounds (alternative). |
minNorthing, maxNorthing | number | OSGB36 northing bounds (alternative). |
Example
curl "https://proxy.c2os.uk:3000/api/naptan?minLat=54.94&maxLat=54.97&minLon=-1.65&maxLon=-1.58"
Returns all GB train stations as a GeoJSON FeatureCollection. Each feature's
properties include name, crs and uic.
Example
curl "https://proxy.c2os.uk:3000/api/trains"
Response (truncated)
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-1.6178, 54.9695] },
"properties": { "name": "Newcastle", "crs": "NCL", "uic": "7052000" }
}
]
}
Scrapes a bustimes.org timetable page and returns the stop sequences (ATCO codes) for each route variant, along with matching NaPTAN CSV rows.
Query parameters
| Name | Type | Notes |
|---|---|---|
url (required) | string (uri) | Must be an https bustimes.org URL. |
Example
curl "https://proxy.c2os.uk:3000/api/extract-atco?url=https://bustimes.org/services/x1"
Responses
| Status | Meaning |
|---|---|
200 | Array of route variants (title, start, end, csvData). |
400 | Invalid url parameter. |
403 | URL host is not allowed. |
500 | Failed to fetch or parse the page. |