I'm working on an android application to check PNR status and seat availability. So is there any public api for getting this information?
I tried many API, but most of them are not working.
CodePudding user response:
Have you tried https://rapidapi.com/IRCTCAPI/api/irctc1 ?
They have some sample examples also,
const axios = require("axios");
const options = {
method: 'GET',
url: 'https://irctc1.p.rapidapi.com/api/v1/getPNRStatus',
params: {pnrNumber: 'xxxxxxxxxx'},
headers: {
'X-RapidAPI-Host': 'irctc1.p.rapidapi.com',
'X-RapidAPI-Key': 'YOUR KEY'
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Note please use your key in X-RapidAPI-Key
Apart from PNR and Seat availability they some more useful API's.