Download the PHP package iaewing/laravel-opensky without Composer
On this page you can find all versions of the php package iaewing/laravel-opensky. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-opensky
Laravel OpenSky Package
A Laravel package for easy integration with the OpenSky Network API. This package provides a simple and elegant way to access real-time and historical aviation data.
Note: This package is for research and non-commercial purposes only, as per OpenSky Network's terms of use. For commercial usage, contact OpenSky Network directly.
Features
- Complete API Coverage: Supports all OpenSky Network REST API endpoints
- Laravel Integration: Native Laravel service provider and facade
- Type-Safe DTOs: Strongly typed data transfer objects for all API responses
- Caching Support: Built-in response caching to reduce API calls
- Rate Limiting: Respects OpenSky API rate limits
- Authentication: Support for both anonymous and authenticated requests
- Comprehensive Testing: Full test coverage with PHPUnit
Requirements
- PHP: 8.1 or higher
- Laravel: 9.x or higher
Installation
Install the package via Composer:
The package will automatically register its service provider in Laravel 9+.
Optionally, publish the configuration file to customize cache settings, timeouts, or other options:
Note: Publishing the config is optional. The package works with default settings using only environment variables.
Configuration
Add your OpenSky credentials to your .env file. OpenSky supports two authentication methods:
Option 1: OAuth2 Client Credentials (Recommended)
Option 2: Legacy Basic Authentication (Being Deprecated)
Note: For new accounts created after March 2025, you must use OAuth2. Legacy basic authentication only works for older accounts.
Authentication Methods
The OpenSky Network API supports two authentication methods:
1. OAuth2 Client Credentials Flow (Recommended)
This is the modern, secure authentication method required for all new accounts created after March 2025:
- Log in to your OpenSky account at https://opensky-network.org/
- Visit the Account page and create a new API client
- Retrieve your
client_idandclient_secret - Add them to your
.envfile:
2. Legacy Basic Authentication (Being Deprecated)
This method uses your OpenSky username and password directly. It only works for legacy accounts created before March 2025:
Important Notes:
- The username/password refer to your OpenSky Network account credentials (not just any random credentials)
- New accounts must use OAuth2
- Legacy basic auth is being phased out
- You need an OpenSky Network account to access authenticated endpoints
- The package automatically prefers OAuth2 over basic auth when both are configured
Anonymous Access
Some endpoints work without authentication but have stricter rate limits:
- Only current data (no historical data)
- 400 API credits per day
- 10-second resolution instead of 5-second
Licensing and Terms of Use
This package respects OpenSky Network's terms of use:
- Research & Non-Commercial Use: Free with API rate limits
- Commercial Use: Requires separate licensing from OpenSky Network
-
Attribution Required: When publishing research, cite the OpenSky paper:
Matthias Schäfer, Martin Strohmeier, Vincent Lenders, Ivan Martinovic and Matthias Wilhelm. "Bringing Up OpenSky: A Large-scale ADS-B Sensor Network for Research". In Proceedings of the 13th IEEE/ACM International Symposium on Information Processing in Sensor Networks (IPSN), pages 83-94, April 2014.
For commercial usage or higher rate limits, contact OpenSky Network directly at https://opensky-network.org/
Usage
Basic Usage with Facade
Dependency Injection
Available Methods
State Vectors
Flights
Tracks
Data Transfer Objects
The package returns strongly typed DTOs for all API responses:
StateVectorResponse
FlightResponse
TrackResponse
Examples
Real-time Flight Tracking
Airport Traffic Analysis
Aircraft Route Tracking
Configuration Options
After publishing the config file (php artisan vendor:publish --tag=opensky-config), you can customize these settings in config/opensky.php:
Rate Limiting
The OpenSky API has different rate limits based on API credits:
- Anonymous users: 400 API credits per day
- Authenticated users: 4000 API credits per day
- Active feeders: 8000 API credits per day
Credit usage varies by request:
- Small areas (0-25 sq deg): 1 credit
- Medium areas (25-100 sq deg): 2 credits
- Large areas (100-400 sq deg): 3 credits
- Global requests (>400 sq deg): 4 credits
The package respects these limits and provides caching to reduce API calls.
Error Handling
The package throws OpenSkyException for API errors:
Testing
This package uses Pest for testing:
License
This package is open-sourced software licensed under the MIT license.
Credits
- Built for the OpenSky Network API
- Inspired by the need for easy aviation data access in Laravel applications
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
OAuth Token Caching
When using OAuth2 authentication, the package automatically caches access tokens to improve performance:
- Token Lifetime: OAuth2 tokens are valid for 30 minutes
- Cache Duration: Tokens are cached for 25 minutes (5 minutes before expiry)
- Automatic Refresh: New tokens are automatically requested when the cached token expires
- Cache Key: Uses a hash of your client_id to ensure uniqueness
- Cache Store: Uses the same cache store configured for API responses
This means you won't need to authenticate on every API call, significantly improving performance for applications making frequent requests.
All versions of laravel-opensky with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0