×

Notice

The forum is in read only mode.

No data when using unix timestamp in api call

7 years 6 months ago - 7 years 6 months ago #200 by Joey1
Hi, I'm trying to get the states using get_states() and specifying time_secs as seconds since epoch. But it never returns anything. Tried passing as int and string. Any ideas?

#No data returned
api = OpenSkyApi()
api.get_states(time_secs="1497376628")
api.get_states(time_secs=1497376628)

#Data returned
api = OpenSkyApi()
api.get_states()
7 years 6 months ago #201 by meides
Hey Joey1,

it looks like you initialized the api without user credentials. Without login you are only able to access live data. Try initializing the api like this:

api = OpenSkyApi(USERNAME, PASSWORD)

Take a look at the documentation for further details. See this page for limitations like the one you experienced.

Cheers,
Marco
The following user(s) said Thank You: Joey1
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!