# Check seat availability and fare (v1)

Check seats for one train, class and quota from the travel date over the next few days, with the confirmation chance and the fare breakdown. A class the train lacks is rejected with a 422.

- Platform: Indian Rail
- Request: `GET https://api.toolzerhub.com/v1/indianrail/train/availability`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/indian-rail/journey/get-indian-rail-availability

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `train` | query | yes | string | A 5-digit train number such as 12951, the number followed by the name, or a train page link from RailYatri, ConfirmTkt, erail or ixigo. Find a number by name with Search trains. |
| `from_station` | query | yes | string | The boarding station code, such as MMCT, or a name with the code in brackets. Find codes by name with Search stations. |
| `to_station` | query | yes | string | The destination station code, such as NDLS, or a name with the code in brackets. Find codes by name with Search stations. |
| `date` | query | no | string | Travel date from the boarding station, today or later. Defaults to today (India time). Dates past the booking window are rejected with the day bookings open. |
| `travel_class` | query | yes | string | Travel class: 1A, 2A, 3A, 3E, SL, CC, EC, EA, 2S, FC, or a name such as sleeper, 3ac or chair car. The classes a train has are in its schedule and in Trains between stations. |
| `quota` | query | no | string | Booking quota: GN general (default), TQ tatkal, PT premium tatkal, LD ladies or SS senior citizen and lower berth. Names such as tatkal work too. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/indianrail/train/availability?train=<train>&from_station=<from_station>&to_station=<to_station>&travel_class=<travel_class>" \
  -H "x-api-key: $TOOLZERHUB_API_KEY"
```

Success responses are wrapped as `{ "data": ... }`. Errors return `{ "error": { "code", "status", "message", "retryable", "details" } }`. See https://docs.toolzerhub.com/docs/responses-and-errors.
