Skip to main content

Fetching Train availability in IRCTC

Problem

When you search for trains in irctc page, it never shows the seat availability directly. You’ll have to manually go and click the refresh button of every listed train

List of trains, but availability is not present

List of trains, but availability is not present

Steps to fix

  1. Search for trains in https://www.irctc.co.in

  2. Apply filters to narrow down the list of trains

Narrow down list of trains using filters

Narrow down list of trains using filters

  1. Paste the following script in console to get the availability status of all trains at once
document.querySelectorAll('.fa.fa-repeat').forEach(el=>el.click())
  1. The end. Tada!

Note:

Ensure that you always try this out after narrowing down the list using filters. Else it’ll be too many requests going on at once.