Source Code
Flight Tracker
Track any flight worldwide using AviationStack API and display in a clean, Flighty-style format.
Quick Start
Track a flight by its IATA code:
scripts/track_flight.py AA100
scripts/track_flight.py UA2402
scripts/track_flight.py BA123
First-Time Setup
Before using this skill, you need an API key (one-time setup):
- Get a free API key at https://aviationstack.com/signup/free (100 requests/month)
- Set environment variable:
export AVIATIONSTACK_API_KEY='your-key-here' - Install dependencies:
pip3 install requests
For detailed setup instructions, see api-setup.md.
Output Format
The skill displays flight information in a clean, readable format with:
- โ๏ธ Airline and flight number
- ๐ฉ๏ธ Aircraft type and registration
- ๐ซ Departure airport, terminal, gate, times
- ๐ฌ Arrival airport, terminal, gate, times
- ๐ Flight status with visual indicators
- โฑ๏ธ Delay calculations (if applicable)
- ๐ Live position, altitude, speed (when airborne)
Status indicators:
- ๐ข Active/Airborne/En-route
- โ Landed/Arrived
- ๐ก Scheduled
- ๐ Delayed
- ๐ด Cancelled
Advanced Usage
Get raw JSON data:
scripts/track_flight.py AA100 --json
Check help:
scripts/track_flight.py --help
Workflow
When a user asks to track a flight:
- Extract the flight number from the request
- Run the tracking script with the flight number
- Present the formatted output to the user
- If data is needed for further processing, use
--jsonflag
Flight Number Formats
Accept IATA flight codes:
- AA100 (American Airlines)
- UA2402 (United)
- BA123 (British Airways)
- DL456 (Delta)
The script automatically converts to uppercase and handles the lookup.
Error Handling
The script handles common errors:
- Missing API key โ Shows setup instructions
- Flight not found โ Suggests verification
- API errors โ Displays error message
- Rate limit exceeded โ Indicates limit reached
API Limits
Free tier: 100 requests/month. Track usage to stay within limits. For heavy usage, consider upgrading or alternative APIs (see references/api-setup.md).
Notes
- Uses AviationStack free tier (no HTTPS on free plan)
- Real-time data updated frequently
- Historical flight data available
- Worldwide coverage (250+ countries, 13,000+ airlines)