Official Python client for the OpenSky Network REST API. By using the OpenSky API, you agree with the terms of use.
- Python 3.10 or later
- requests library
Install directly from GitHub using pip (recommended):
pip install "git+https://github.com/openskynetwork/opensky-api.git#subdirectory=python"
Or clone the repository and install locally:
git clone https://github.com/openskynetwork/opensky-api.git
pip install -e opensky-api/python
Since March 18, 2026, basic authentication with username and password is no longer supported. Authentication now uses the OAuth2 client credentials flow.
- Log in to your OpenSky account and visit the Account page.
- Create a new API client and download the credentials file (
credentials.json). - Pass the credentials to the API client as shown below.
Without credentials, requests are made anonymously with reduced rate limits.
Anonymous access (reduced rate limits):
from opensky_api import OpenSkyApi
api = OpenSkyApi()
s = api.get_states()
print(s)Authenticated access using a credentials file:
from opensky_api import OpenSkyApi, TokenManager
api = OpenSkyApi(token_manager=TokenManager.from_json_file("credentials.json"))
s = api.get_states()
print(s)The token is refreshed automatically before it expires, so no manual token management is required.
The client also supports use as a context manager:
with OpenSkyApi(token_manager=TokenManager.from_json_file("credentials.json")) as api:
states = api.get_states(bbox=(47.2, 55.1, 5.9, 15.1)){
'states': [
StateVector(dict_values(['c04049', '', 'Canada', 1507203246, 1507203249, -81.126, 37.774, 10980.42, False, 245.93, 186.49, 0.33, None, 10972.8, None, False, 0])),
StateVector(dict_values(['4240eb', 'UTA716 ', 'United Kingdom', 1507202967, 1507202981, 37.4429, 55.6265, 609.6, True, 92.52, 281.87, -3.25, None, None, '4325', False, 0])),
...
],
'time': 1507203250
}
- Full API documentation
- OpenSky Discord
- Data Tools – third-party and community libraries