Documentation

Here you can find sample code to implement our API.


  $( document). ready (function () {
  //get-pnr-status is the id of the button or  link.
  $('#pnrstatus' ).click (function(){
  $. ajax ({
  //1234567890 is the pnr number. replace with  the variable.
  url:  'http://indianrailapi.com/api/pnrstatus/apikey/abc...xyz/pnr/1234567890/',
  method: 'GET',
  crossDomain: true,
  dataType: 'json',
  success: function(data){
  //You will need json2js for this alert.
  alert(JSON.stringify(data));
  //result is the id of div where this response json will be displayed.
  $('#result').html(JSON.stringify(data));
  },
  error: function(data){
  alert('ERROR');
  }
  });
  });
  }); 
    
         
    
Contributed By : Nimesh Bansal
Note: If you are too beginner in development, you can use our services in Rs. 500.(Only for paid users.) (C#.Net, VB.Net, JQuery, AngularJS Only.)
Developers are requested to contact at admin@indianrailapi.com with sample code to become support members. Sample code must be uploaded in github, google drive and so on.