# Irctc — 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.

> Search for trains between Indian Railway stations and instantly check fares, seat availability, and schedules all in one place. Book your journey with real-time information about train options and pricing through IRCTC Railway data.

**Category:** Travel | **Website:** [www.irctc.co.in/](https://www.irctc.co.in/) | **Docs:** [parse.bot/marketplace/4c502fad-322b-4ab2-9e45-a971390708a5/irctc-co-in-api](https://parse.bot/marketplace/4c502fad-322b-4ab2-9e45-a971390708a5/irctc-co-in-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-irctc-co-in-api-4c502fad/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### check_availability

Check seat availability and current fare for a train on a given date and class. Returns availability status (e.g. AVAILABLE-0059, GNWL14/RAC28) for the queried date and several subsequent days, along with fare details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | Journey date in ISO format YYYY-MM-DD. |
| `destination_station` | string | Yes | Destination station code (e.g. BVI for Borivali). |
| `quota` | string | No | Booking quota code. Common values: GN (General), TQ (Tatkal), PT (Premium Tatkal), LD (Ladies), HP (Handicapped). |
| `source_station` | string | Yes | Source station code (e.g. NDLS for New Delhi). |
| `train_number` | string | Yes | 5-digit train number (e.g. 12952). |
| `travel_class` | string | Yes | Travel class code (e.g. SL, 3A, 2A, 1A, CC, EC, 3E, 2S). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-irctc-co-in-api-4c502fad/check_availability \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","destination_station":"<string>","quota":"<string>","source_station":"<string>","train_number":"<string>","travel_class":"<string>"}'
```

### get_fare

Get fare breakdown for a specific train, route, and travel class. Returns base fare, reservation charge, superfast charge, dynamic pricing, catering, service tax, and total fare. Uses a date 7 days from today to ensure the query is always valid.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `destination_station` | string | Yes | Destination station code (e.g. BVI for Borivali). |
| `source_station` | string | Yes | Source station code (e.g. NDLS for New Delhi). |
| `train_number` | string | Yes | 5-digit train number (e.g. 12952). |
| `travel_class` | string | Yes | Travel class code (e.g. SL, 3A, 2A, 1A, CC, EC, 3E, 2S). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-irctc-co-in-api-4c502fad/get_fare \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"destination_station":"<string>","source_station":"<string>","train_number":"<string>","travel_class":"<string>"}'
```

### search_trains

Search trains running between two stations on a given date. Returns all trains with their schedule, available classes, and running days. Results include both direct trains and nearby-station options the railway shows for the route.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | Journey date in ISO format YYYY-MM-DD. |
| `destination_station` | string | Yes | Destination station code (e.g. BCT for Mumbai Central, MAS for Chennai). |
| `source_station` | string | Yes | Source station code (e.g. NDLS for New Delhi, BCT for Mumbai Central, HWH for Howrah). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-irctc-co-in-api-4c502fad/search_trains \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","destination_station":"<string>","source_station":"<string>"}'
```
