Created
September 15, 2014 17:38
-
-
Save amjd/ce4a1b2d7931dcd517f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests as r | |
import json | |
pnr = "6533533388" | |
url = "https://indianrailways.p.mashape.com/index.php?pnr=" | |
headers = {'X-Mashape-Authorization': 'MASHAPE_API_KEY'} | |
data = r.get('%s%s' % (url,pnr),headers=headers) | |
data_json = json.loads(data.text) | |
print "YPR to NGP:", data_json['bookingStatus'][0]['currentStatus'] | |
#You can get your API key at https://www.mashape.com/blaazetech/indian-railways |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment