Closed espinielli closed 1 year ago
In fact if you are authenticated you do not get the extra last field in each state vector record.
For example:
$ curl -k -u "$OPENSKY_USERNAME:$OPENSKY_PASSWORD" \
"https://opensky-network.org/api/states/all?lomin=17.893604&lamin=59.62179&lomax=17.989391&lamax=59.671582"
{
"time": 1643708306,
"states": [
[
"5001ac",
"VAJ91B ",
"San Marino",
1643708306,
1643708306,
17.925,
59.6559,
null,
true,
5.66,
163.12,
null,
null,
null,
"1145",
false,
0
],
[
"4afbb0",
"BRV3 ",
"Sweden",
1643708305,
1643708305,
17.9473,
59.6599,
null,
true,
11.32,
255.94,
null,
null,
null,
null,
false,
0
],
[
"4afb8a",
"BRV 4 ",
"Sweden",
1643708305,
1643708305,
17.9472,
59.6598,
null,
true,
11.32,
255.94,
null,
null,
null,
null,
false,
0
],
[
"4afb03",
"139 ",
"Sweden",
1643708305,
1643708305,
17.9303,
59.6558,
null,
true,
12.86,
253.12,
null,
null,
null,
null,
false,
0
]
]
}
I would suggest to document the behaviour or make the payload, state vector, the same in both cases. (my preference goes to the latter where the state vector payload stays at the same number of fields)
We did some changes on this a while ago; is this consistent now with your expectations?
I just created a pull request for an updated version of the Python API. The magic seems to be in the request parameter "extended=true".
curl -k -u "$OPENSKY_USERNAME:$OPENSKY_PASSWORD" \ "https://opensky-network.org/api/states/all?lomin=17.893604&lamin=59.62179&lomax=17.989391&lamax=59.671582"
Yes. Well done. BUT just by querying for a while I only see 0 values for category (field 17)...is it really computed in the LIVE API?
II just tried repeatedly curl -k -u "$OPENSKY_USERNAME:$OPENSKY_PASSWORD" \ "https://opensky-network.org/api/states/all?extended=true&lomin=17.893604&lamin=59.62179&lomax=17.989391&lamax=59.671582" I see the non zero category sometimes for some aircraft. When I tried it on all states without filter, I found some 3, 4 and 6 besides a lot of zeros.
The responses the above query were: {"time":1671882206,"states":[["4b1806","SWR7ZP ","Switzerland",1671882203,1671882205,17.9293,59.6533,null,true,0,101.25,null,null,null,null,false,0,0],["4b1808","SWR5139 ","Switzerland",1671882197,1671882202,17.9314,59.6537,null,true,0,219.38,null,null,null,null,false,0,0],["885104","THA961 ","Thailand",1671882198,1671882204,17.9361,59.6529,null,true,0,101.25,null,null,null,null,false,0,0]]} {"time":1671882218,"states":[["4b1806","SWR7ZP ","Switzerland",1671882214,1671882218,17.9293,59.6533,null,true,0,101.25,null,null,null,null,false,0,0],["4b1808","SWR5139 ","Switzerland",1671882208,1671882218,17.9314,59.6537,null,true,0,219.38,null,null,null,null,false,0,0],["885104","THA961 ","Thailand",1671882198,1671882216,17.9361,59.6529,null,true,0,101.25,null,null,null,null,false,0,6]]} {"time":1671882384,"states":[["4b1806","SWR7ZP ","Switzerland",1671882382,1671882382,17.9293,59.6533,null,true,0,101.25,null,null,null,null,false,0,0],["4b1808","SWR5139 ","Switzerland",1671882382,1671882382,17.9314,59.6537,null,true,0,219.38,null,null,null,null,false,0,0],["885104","THA961 ","Thailand",1671882358,1671882358,17.9361,59.6529,null,true,0,101.25,null,null,null,null,false,0,6]]}
Great. Thanks Jannis for testing further
The states returned by the REST API for state vector contain 18 fields instead of 17 as stated in the documentation [1], see table below, or in the (Python) code [2].
(Also FLARM value in
position_source
in the source [2] is not reflected in the online documentation [1]...which probably needs to be refreshed/republished)[1] https://opensky-network.org/apidoc/rest.html#response [2] https://github.com/openskynetwork/opensky-api/blob/master/python/opensky_api.py#L37-L56
I executed the following request:
which returned (Note that each state contains 18 fields):