From 72bdae405c11cb3921668ca7cb4d9ef06e7f7f12 Mon Sep 17 00:00:00 2001 From: altf4arnold Date: Mon, 18 Mar 2024 20:28:48 +0100 Subject: [PATCH] Base --- config.py | 1 + datapull.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 config.py create mode 100644 datapull.py 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") +