Input Validation

PNR

Exactly 10 digits
Numeric input only
Reject malformed values early

Train Number

5 digits for train data; number lookup accepts 2–5 digit prefixes
Treat as string to preserve zeros
No spaces or symbols

Date

DD-MM-YYYY format
Validate real calendar date
Use same format across APIs

Station Code

Uppercase station code
Examples: NDLS, BCT, HWH
Trim extra whitespace