up# Israeli Flight Information API
A Flask-based REST API that provides real-time flight information for Israeli airports, primarily Ben Gurion International Airport. The API scrapes data from the Israel Airports Authority (IAA) website and includes fallback options for third-party aviation APIs.
- Real-time Flight Data: Get live arrivals and departures from Ben Gurion Airport
- Multiple Data Sources: Primary scraper with Aviation Edge API fallback
- Redis Caching: High-performance caching with in-memory fallback
- Docker Support: Fully containerized with Docker Compose
- RESTful API: Clean, well-documented endpoints
- Error Handling: Comprehensive error handling and logging
- Health Checks: Built-in health monitoring
- Configuration Management: Environment-based configuration
GET /- API information and available endpointsGET /health- Health check with cache statusGET /flights/arrivals- Get arriving flightsGET /flights/departures- Get departing flightsGET /flights/{flight_number}- Get specific flight information
GET /cache/info- Cache statistics and informationPOST /cache/clear- Clear all cached dataGET /config- API configuration information
page- Page number for pagination (default: 1)per_page- Items per page (default: 50, max: 100)mock- Use mock data instead of live data (default: false)
- Clone and navigate to the project:
git clone <repository-url>
cd API-Project- Start the services:
docker-compose up -d- Test the API:
curl http://localhost:5000/health- Install dependencies:
pip install -r requirements.txt- Start Redis (optional, will fallback to in-memory cache):
redis-server- Run the application:
python app.pyConfigure the API using environment variables:
DEBUG- Enable debug mode (default: false)PORT- Server port (default: 5000)HOST- Server host (default: 0.0.0.0)LOG_LEVEL- Logging level (default: INFO)
REDIS_HOST- Redis server host (default: localhost)REDIS_PORT- Redis server port (default: 6379)REDIS_DB- Redis database number (default: 0)
CACHE_DEFAULT_TTL- Default cache TTL in seconds (default: 300)FLIGHT_CACHE_TTL- Flight-specific cache TTL (default: 180)
AVIATION_EDGE_API_KEY- Aviation Edge API key (optional)USE_MOCK_DATA- Force use of mock data (default: false)MAX_PER_PAGE- Maximum items per page (default: 100)DEFAULT_PER_PAGE- Default items per page (default: 50)
SCRAPER_TIMEOUT- HTTP request timeout (default: 10)
curl "http://localhost:5000/flights/arrivals?page=1&per_page=10"curl "http://localhost:5000/flights/LY315"curl "http://localhost:5000/flights/departures?mock=true"{
"flight_number": "LY315",
"airline": "EL AL",
"flight_type": "departure",
"scheduled_time": "2025-01-15T14:30:00",
"actual_time": "2025-01-15T14:35:00",
"estimated_time": null,
"status": "departed",
"origin": "Tel Aviv",
"destination": "New York",
"terminal": "Terminal 3",
"gate": "Gate 15",
"aircraft_type": "Boeing 777"
}{
"flights": [...],
"total_count": 45,
"page": 1,
"per_page": 10,
"last_updated": "2025-01-15T12:00:00"
}- Primary: Israel Airports Authority (IAA) website scraper
- Fallback: Aviation Edge API (requires API key)
- Development: Mock data generator
├── app.py # Main Flask application
├── config.py # Configuration management
├── models/
│ ├── __init__.py
│ └── flight.py # Flight data models
├── services/
│ ├── __init__.py
│ ├── flight_scraper.py # IAA website scraper
│ ├── aviation_api.py # Aviation Edge API client
│ └── cache.py # Redis caching service
├── requirements.txt # Python dependencies
├── Dockerfile # Container definition
├── docker-compose.yml # Multi-service setup
└── README.md # This file
# Test with mock data
curl "http://localhost:5000/flights/arrivals?mock=true"
# Check health status
curl "http://localhost:5000/health"
# View cache information
curl "http://localhost:5000/cache/info"docker build -t israeli-flight-api .export DEBUG=true
export LOG_LEVEL=DEBUG
python app.pyThe API includes built-in health checks and monitoring:
- Health endpoint provides service status and cache information
- Comprehensive logging with configurable levels
- Docker health checks for container orchestration
- Redis connection monitoring with fallback handling
- Primary data source depends on IAA website structure
- Rate limiting not implemented (relies on caching)
- Currently focused on Ben Gurion Airport (TLV)
- Aviation Edge API requires paid subscription for production use
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.