# Trainline Best Fares API Documentation

<p><strong>Trainline Best Fares API Documentation</strong> Read the list of popular routes with the lowest fare, the duration and the path of the route on the Trainline site. The list is small and fixed. Use the fare calendar for a route of your own.</p>

- **Documentation:** [https://scrappa.co/docs/trainline-api/trainline_best_fares](https://scrappa.co/docs/trainline-api/trainline_best_fares)
- **API group:** Trainline API
- **Endpoint:** `GET https://scrappa.co/api/trainline/fares/best`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Example response

```json
{
    "data": {
        "fares": [
            {
                "path": "/train-times/london-to-paris",
                "origin": {
                    "name": "London"
                },
                "is_reverse": true,
                "price_from": {
                    "amount": 53,
                    "currency": "GBP"
                },
                "destination": {
                    "name": "Paris"
                },
                "duration_minutes": 148
            },
            {
                "path": "/train-times/paris-to-amsterdam",
                "origin": {
                    "name": "Paris"
                },
                "is_reverse": true,
                "price_from": {
                    "amount": 30.88,
                    "currency": "GBP"
                },
                "destination": {
                    "name": "Amsterdam"
                },
                "duration_minutes": 210
            },
            {
                "path": "/train-times/barcelona-to-madrid",
                "origin": {
                    "name": "Barcelona"
                },
                "is_reverse": true,
                "price_from": {
                    "amount": 16.76,
                    "currency": "GBP"
                },
                "destination": {
                    "name": "Madrid"
                },
                "duration_minutes": 182
            }
        ],
        "fare_count": 3
    },
    "meta": {
        "billable": true,
        "endpoint_family": "fares_best"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 503 | Upstream Unavailable | Trainline did not answer in time. Scrappa retries on other exits first. This response is not billable. Retry after a few seconds. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
