This commit is contained in:
Arnold Dechamps 2024-03-18 20:28:48 +01:00
parent 6080faabc8
commit 72bdae405c
No known key found for this signature in database
GPG key ID: AE66543374E41C89
2 changed files with 21 additions and 0 deletions

1
config.py Normal file
View file

@ -0,0 +1 @@
FLIGHTAWAREKEY = "V3rYs3cr3t"

20
datapull.py Normal file
View file

@ -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")