# Trainline Railcards API Documentation

<p><strong>Trainline Railcards API Documentation</strong> List the UK railcards and discount cards with the name, the description, the carriers that accept them, the card number rules and whether the card runs out.</p>

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

## 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": {
        "cards": [
            {
                "code": "urn:trainline:atoc:card:G5O",
                "name": "Club 50 Web - Greater Anglia",
                "group": null,
                "colour": null,
                "carriers": [
                    "atoc"
                ],
                "language": "en",
                "operator": null,
                "short_name": null,
                "description": "Club 50 Web - Greater Anglia",
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": false
            },
            {
                "code": "urn:trainline:atoc:card:DCR",
                "name": "Devon & Cornwall Railcard",
                "group": null,
                "colour": null,
                "carriers": [
                    "atoc"
                ],
                "language": "en",
                "operator": null,
                "short_name": null,
                "description": "Devon & Cornwall Railcard",
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": false
            },
            {
                "code": "urn:trainline:atoc:card:FAM",
                "name": "Family & Friends Railcard",
                "group": null,
                "colour": null,
                "carriers": [
                    "atoc"
                ],
                "language": "en",
                "operator": null,
                "short_name": null,
                "description": "Family & Friends Railcard",
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": false
            },
            {
                "code": "urn:trainline:atoc:card:HRC",
                "name": "Highland Railcard",
                "group": null,
                "colour": null,
                "carriers": [
                    "atoc"
                ],
                "language": "en",
                "operator": null,
                "short_name": null,
                "description": "Highland Railcard",
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": false
            }
        ],
        "card_count": 4
    },
    "meta": {
        "billable": true,
        "endpoint_family": "cards"
    },
    "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)
