Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WebHT/opensky-api

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The official OpenSky Network API

This repository contains API client implementations for the OpenSky Network in Python and Java as well as the sources for the documentation. By using the OpenSky API, you agree with our terms of use.

Python API

Installation

sudo python setup.py install

or with pip (recommended)

pip install -e /path/to/repository/python

Usage

from opensky_api import OpenSkyApi
api = OpenSkyApi()
s = api.get_states()
print(s)

will output something like this:

{   'earliest': 1371222960,
    'states': [   {   'altitude': 9075.42,
    'callsign': 'YZR7453',
    'heading': 124.78,
    'icao24': '78072a',
    'latitude': 51.626,
    'longitude': 6.8621,
    'on_ground': False,
    'origin_country': 'China',
    'sensors': [90003, 90002, 90006],
    'time_position': 1456583158,
    'time_velocity': 1456583158,
    'velocity': 248,
    'vertical_rate': 0},
                  {   'altitude': 4564.38,
    'callsign': 'XK103JA',
    'heading': 45,
    'icao24': '3945f8',
    'latitude': 42.9847,
    'longitude': 7.7095,
    'on_ground': False,
    'origin_country': 'France',
    'sensors': [31813],
    'time_position': 1456583158,
    'time_velocity': 1456582189,
    'velocity': 59.16,
    'vertical_rate': None},
    ...

Java API

  • Maven project (not yet in a public repository)
  • Uses OkHttp for HTTP requests

Installation

For usage with Maven

mvn clean install

Add the following dependency to your project

<dependency>
    <groupId>org.opensky</groupId>
    <artifactId>opensky-api</artifactId>
    <version>1.1.0</version>
</dependency>

Usage

OpenSkyStates states = new OpenSkyApi().getStates(0);
System.out.println("Number of states: " + states.getStates().size());

Using the API within Android Apps

Build and install the OpenSky API in your local repository as described above. You can use it within your Android App by telling gradle to lookup the local repository and adding the dependencies.

In build.gradle, add the following lines

dependencies {
    /* do not delete the other entries, just add this one */
    compile 'org.opensky:opensky-api:1.1.0'
}

repositories {
    mavenLocal()
    mavenCentral()
}

Also note, that you need the INTERNET permission in your manifest to use the API.

Running behind a Proxy

If you need to use a proxy server, set the http.proxyHost and http.proxyPort flags when starting your application:

java -Dhttp.proxyHost=10.0.0.10 -Dhttp.proxyPort=9090 ...

Resources

About

Python and Java bindings for the OpenSky Network REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 71.8%
  • Python 28.2%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.