Developer guide
PNR Status API Guide
Use a 10-digit PNR to retrieve booking and current passenger status, journey details, train information, and chart status. Send requests from your backend so your API key stays private.
GET /api/v1/pnr/:pnr
Get started
- Create a RailKit account and generate an API key in your dashboard.
- Set RAILKIT_API_KEY and PNR in your server environment. PNR must contain exactly 10 digits.
- Call the endpoint with the x-api-key header. Replace PNR with a valid booking number you are authorized to use.
Request example
Run from a server terminal. Replace example credentials and input values with your own.
export RAILKIT_API_KEY="your_api_key"
export PNR="your_10_digit_pnr"
curl "https://api.railkit.in/api/v1/pnr/$PNR" \
-H "x-api-key: $RAILKIT_API_KEY" \
-H "accept: application/json"Response example
{
"success": true,
"data": {
"pnr": "1234567890",
"train": { "number": "18021", "name": "Example Express" },
"journey": {
"source": { "code": "KGP", "name": "KHARAGPUR JN" },
"destination": { "code": "KUR", "name": "KHURDA ROAD JN" }
},
"chart": { "status": "Chart Not Prepared" },
"passengers": [{
"booking": { "status": "WL", "details": "WL/12" },
"current": { "status": "CNF", "details": "CNF/C1/30" }
}]
}
}- booking records original reservation status; current records latest reported allocation.
- Check success before reading data. Passenger fields may be absent or null until charting or allocation completes.
- Example response is illustrative; field availability depends on upstream railway data.
Data freshness
PNR status can change as the railway processes bookings and prepares charts. Recheck when users need an update; do not promise instant changes. The endpoint does not provide a guaranteed update interval.
Errors and recovery
- 400: PNR is malformed. Validate exactly 10 digits before sending.
- 401 or 403: API key is missing, invalid, or inactive. Check server configuration.
- 404: PNR has no available record. Confirm number before retrying.
- 429: Request limit reached. Back off and check plan usage; avoid rapid polling.
- 5xx or upstream failure: Retry later with bounded backoff and show last known result if available.