Skip to content

Instantly share code, notes, and snippets.

@jakekara
Last active December 23, 2016 19:57
Show Gist options
  • Save jakekara/4ba60d06f8902118c8e521bbc6a92327 to your computer and use it in GitHub Desktop.
Save jakekara/4ba60d06f8902118c8e521bbc6a92327 to your computer and use it in GitHub Desktop.
get FAA airport status
import requests
def status_url(code):
return "http://services.faa.gov/airport/status/" + code + "?format=application/json"
def get_status(code):
r = requests.get(status_url(code))
if r.status_code != 200:
raise Exception ("Error fetching status for airport " + code+ ": <Status: " + str(r.status_code) + ">")
return r.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment