← Back to the map

NaPTAN Explorer API

Read-only endpoints powering the map. Base URL: https://proxy.c2os.uk:3000

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.

GET /api/naptan

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

NameTypeNotes
minLat, maxLatnumberWGS84 latitude bounds.
minLon, maxLonnumberWGS84 longitude bounds.
minEasting, maxEastingnumberOSGB36 easting bounds (alternative).
minNorthing, maxNorthingnumberOSGB36 northing bounds (alternative).

Example

curl "https://proxy.c2os.uk:3000/api/naptan?minLat=54.94&maxLat=54.97&minLon=-1.65&maxLon=-1.58"
GET /api/trains

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" }
    }
  ]
}
GET /api/extract-atco

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

NameTypeNotes
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

StatusMeaning
200Array of route variants (title, start, end, csvData).
400Invalid url parameter.
403URL host is not allowed.
500Failed to fetch or parse the page.