# Trainline Discount Cards API Documentation

<p><strong>Trainline Discount Cards API Documentation</strong> List the discount cards of UK and European carriers with the name, the operator, the language, the carriers that accept them and the number format.</p>

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

## 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:sncf:card:GrandEstCartePrimo",
                "name": "Carte Grand-Est Primo",
                "group": "sncf_regional",
                "colour": "#6A7C00",
                "carriers": [
                    "pao_sncf"
                ],
                "language": "fr",
                "operator": "SNCF",
                "short_name": "Primo",
                "description": null,
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": true
            },
            {
                "code": "urn:trainline:multivendors:card:SpainFamiliaNumerosaEspecialAsturias",
                "name": "Familia Numerosa Especial Asturias",
                "group": "large_family_discount",
                "colour": "#950A00",
                "carriers": [
                    "renfe",
                    "ilsa"
                ],
                "language": "es",
                "operator": "SpainRail",
                "short_name": "Familia numerosa",
                "description": null,
                "business_only": false,
                "number_pattern": "^[0-9]{2}[-/ ]?[0-9]{4}[-/ ]?[0-9]{4}$",
                "is_loyalty_card": false,
                "requires_number": true,
                "has_expiration_date": true
            },
            {
                "code": "urn:trainline:sncf:card:NouvelleAquitaineCarteAvantagesPlus",
                "name": "Nouvelle-Aquitaine Carte\u00a0+",
                "group": "sncf_regional",
                "colour": "#9b1723",
                "carriers": [
                    "pao_sncf"
                ],
                "language": "fr",
                "operator": "SNCF",
                "short_name": "Carte\u00a0+",
                "description": null,
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": true
            },
            {
                "code": "urn:trainline:obb:card:VORTEILScardComfort",
                "name": "VORTEILScard Comfort",
                "group": null,
                "colour": "#D53B4A",
                "carriers": [
                    "obb"
                ],
                "language": "de",
                "operator": "OBB",
                "short_name": "",
                "description": null,
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": true
            }
        ],
        "card_count": 4
    },
    "meta": {
        "billable": true,
        "endpoint_family": "cards_discounts"
    },
    "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)
