400 return: Bad JSON request

6 years 9 months ago - 6 years 9 months ago #211 by Joey1
Hi,

I am trying to get plane state vectors by using the REST API and providing timestamp. But get Response 400 only when using timestamp.

Below is the output. Any help would be appreciated.
Python 2.7.10 (default, Feb  7 2017, 00:08:15) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> import requests
>>> UNIX_TIMESTAMP = int(time.time())
>>> UNIX_TIMESTAMP
1498769637
>>> OPENSKY_API_URL = "https://opensky-network.org/api/states/all?time={}".format(UNIX_TIMESTAMP)
>>> response = requests.get(OPENSKY_API_URL)
>>> response
<Response [400]>

Please Log in or Create an account to join the conversation.

6 years 9 months ago #212 by schaefer
Hi Joey,

there are some limitations for using the REST API. Please refer to the documentation:
opensky-network.org/apidoc/rest.html#limitations
You are lacking the rights to retrieve historical data.

Other than that, we also have a Python binding for the REST API:
github.com/openskynetwork/opensky-api

Cheers,
Matthias

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
This website uses cookies to offer you the best experience of our services. By using this website you agree to our privacy policy!