API Reference
API Reference
National Rail API Integration
GET /api/getServices
Retrieves live train service information for a specified UK railway station from the National Rail Darwin API.
Description
Fetches real-time departure and arrival information for trains at a given station using the station's CRS code. This endpoint is deployed as a Cloudflare Worker function.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
crs | string | Yes | Three-letter CRS (Computer Reservation System) code for the station (e.g., "KGX" for King's Cross) |
numRows | number | No | Number of services to return (default varies) |
timeOffset | number | No | Time offset in minutes from current time |
timeWindow | number | No | Time window in minutes to fetch services for |
Response
Returns a JSON object containing train service information processed from the Darwin API.
Last updated on