diff --git a/config.py b/config.py new file mode 100644 index 0000000..440726f --- /dev/null +++ b/config.py @@ -0,0 +1 @@ +FLIGHTAWAREKEY = "V3rYs3cr3t" \ No newline at end of file diff --git a/datapull.py b/datapull.py new file mode 100644 index 0000000..0b4536f --- /dev/null +++ b/datapull.py @@ -0,0 +1,20 @@ +""" +Little script written by Arnold Dechamps +""" +import config +import requests + +apiUrl = "https://aeroapi.flightaware.com/aeroapi/" + +airport = 'EBBR' +payload = {'max_pages': 2} +auth_header = {'x-apikey':config.FLIGHTAWAREKEY} + +response = requests.get(apiUrl + f"airports/{airport}/flights", + params=payload, headers=auth_header) + +if response.status_code == 200: + print(response.json()) +else: + print("Error executing request") +