This Python script fetches flight data from the FlightAware API and stores it in an InfluxDB database. This is made for InfluxDB cloud v3 for Flight aware API. Flight Aware is a very popular flight data aggregator. Its a common tool in the aviation industry, and for myself its where I go to find out information about my own upcoming flights.
We have some code for the Open Sky API using InfluxDB v2, the Open Sky API is not updated very often and is probably not ideal for use with a time series database.
What things you need to install the software and how to install them:
- Python 3
- pandas
- requests
- influxdb_client_3
- Flight Aware API
- InfluxDB v3 Token
- OptionalGrafana Dashboard
- Optional Open Sky API
A step by step series of examples that tell you how to get a development environment running:
- Clone the repository
- Install dependencies with
pip install pandas requests influxdb3-python
- Create a
secret.py
file with your FlightAware API key and InfluxDB token - Run the script with
python flightAware.py
The script runs in an infinite loop, fetching flight data every 5 minutes, you could make it shorter or longer, but this API is not free. It fetches data for flights within a specified bounding box and stores the data in an InfluxDB database. There is a link to a website to create your own boundbox, for example where you live.
These are a collection of youtube videos that go over this project more in depth.
- Building the Grafana Dashboard
- Building the Grafana Dashboard with Variables
- Building Alerting in Grafana
- Coming soon [Basic Python/InfluxDB Tutorial] - Based off this project
- Coming soon [FlightAware and InfluxDB] - Walkthrough of the project
- Coming soon [Running Python Script on Github actions] Based off this project
- The test files can be used to test a json file and input into influxdb before you start calling the API for real. Make sure you are happy with the data you are sending in first.
- The JSON file can be uploaded into Grafana and if you choose to send the same data as me should populate effectivley.
- Change the open sky API to be the new influxdb v3 python library instead of v2.
- Submited this project to flight aware so they can use it as an example[flightaware/aeroapps#18]
- Add instructions on how to run this on github actions
- Add real test files
- Find a good way to save and use the way points.
- Create other front ends for the project in superset, etc.