# Nationalrail — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.

**Category:** Travel | **Website:** [nationalrail.co.uk/](https://nationalrail.co.uk/) | **Docs:** [parse.bot/marketplace/e5c3583a-ceb9-4766-a9d1-df4a84ca6f29/nationalrail-co-uk-api](https://parse.bot/marketplace/e5c3583a-ceb9-4766-a9d1-df4a84ca6f29/nationalrail-co-uk-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_disruptions

Retrieve current service disruptions, cleared disruptions, engineering works, and train operator service indicators for the UK National Rail network. Returns all current and recently-cleared incidents plus per-operator service status.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/get_disruptions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_live_arrivals

Get real-time live arrival board for a station via GraphQL. Returns upcoming arrivals with scheduled/estimated times, origins, operators, platform numbers, and service status. Results reflect the current moment — empty services array means no upcoming arrivals.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `crs` | string | Yes | 3-letter CRS code of the station (e.g. 'KGX' for Kings Cross, 'EUS' for Euston, 'PAD' for Paddington) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/get_live_arrivals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"crs":"<string>"}'
```

### get_live_departures

Get real-time live departure board for a station via GraphQL. Returns upcoming departures with scheduled/estimated times, destinations, operators, platform numbers, and service status. Results reflect the current moment — empty services array means no upcoming departures.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `crs` | string | Yes | 3-letter CRS code of the station (e.g. 'KGX' for Kings Cross, 'EUS' for Euston, 'PAD' for Paddington) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/get_live_departures \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"crs":"<string>"}'
```

### get_station_details

Get comprehensive station information including address, location coordinates, facilities, accessibility details, transport links, ticket buying options, and platform facilities. Data is sourced from the station's dedicated page on National Rail.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | Station URL slug (e.g. 'london-euston', 'manchester-piccadilly', 'birmingham-new-street') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/get_station_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### get_stations

Retrieve the full list of UK rail stations and their CRS codes. Returns all stations including National Rail, London Underground, and Docklands Light Railway classifications. No parameters required — returns the complete station reference dataset in a single page.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/get_stations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_stations

Search for stations by name or partial name using the National Rail autocomplete service. Returns matching stations with their CRS codes, coordinates, and classification. Useful for resolving a user query to a CRS code before fetching live boards.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search term for station name or CRS code (e.g. 'Euston', 'Manchester', 'PAD') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nationalrail-co-uk-api-e5c3583a/search_stations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
