The bot analyzes global flight data obtained from opensky-network.org to detect unusual movements of private jets.
We focus on private planes (Business Jets, Ultra Long Range) to identify potential mass exodus events of high-net-worth individuals. When a significant cluster of private flights departs from a specific country within a short time window, it triggers an anomaly alert.
This system monitors the whole world using reverse geocoding to identify the origin of flights.
Then a message is created on Twitter about the threat. Example:

I'm open to any help or suggestions, I realize there are many better ways to improve this program and better ways to get this program to work properly.
- Install dependencies:
pip install -r requirements.txt - Copy
.env-cloneto.envand fill in your OpenSky and Twitter credentials. - Run the bot:
python main.py
This bot uses Twitter API v2. You need to provide the following credentials in .env:
CONSUMER_KEY(API Key)CONSUMER_SECRET(API Key Secret)ACCESS_TOKENACCESS_SECRET
Make sure your App has Read and Write permissions.
This project is configured for Vercel with Cron Jobs.
- Install Vercel CLI:
npm i -g vercel - Run
vercelto deploy. - Set Environment Variables in Vercel Dashboard.
- The bot will run automatically every 5 minutes via Vercel Cron.
Note on Storage:
By default, this bot uses a local flight_history.json file. On serverless platforms like Vercel, this file is ephemeral.
To enable persistent storage, this project supports Vercel KV (Redis).
- Go to your Vercel Project Dashboard > Storage.
- Create a new Vercel KV database.
- Bind it to your project.
- Vercel will automatically set the
KV_URLenvironment variable. - The bot will now automatically use Redis for storing flight history.
If you prefer a completely free alternative to Redis, you can use Google Sheets.
- Create a project in Google Cloud Console.
- Enable Google Sheets API and Google Drive API.
- Create a Service Account and download the JSON key.
- Encode the JSON key to Base64 (to fit in a single line):
base64 -i your-key.json
- Set environment variable
GOOGLE_SHEETS_CREDENTIALSwith the Base64 string. - The bot will create a sheet named
WarDetection_Historyautomatically. (Note: You might need to share the sheet with your personal email to view it, as it is created by the service account).
You can also use Upstash Redis which offers a generous free tier.
- Create a database on Upstash.
- Get the
REDIS_URL. - Set
REDIS_URLin your Vercel Environment Variables.
If you want to run this bot without any hosting costs and bypass Vercel's Cron limitations:
-
Push this code to a GitHub Repository.
-
Go to Settings > Secrets and variables > Actions in your repo.
-
Add the following Repository secrets:
CONSUMER_KEY,CONSUMER_SECRET,ACCESS_TOKEN,ACCESS_SECRET(Twitter)OPENSKY_USERNAME,OPENSKY_PASSWORD(OpenSky - Optional)GOOGLE_SHEETS_CREDENTIALS(Base64 string) ORREDIS_URL(Upstash)
Important: You MUST use Google Sheets or Redis for storage because GitHub Actions resets the filesystem on every run.
-
The bot is already configured (in
.github/workflows/scheduler.yml) to run every ~5 minutes automatically. -
You can check the "Actions" tab in GitHub to see the logs.
