Skip to content

REST API missing one field in the reply #71

@espinielli

Description

@espinielli

It looks like something similar to #42 is happening.
The docs specify that the REST API return 18 fields, the last being the category of the aircraft

I performed both an anonymous and an authenticated request, still only 17 fields are returned, while the last field (I think) is not present.

λ> curl -H "Authorization: Bearer $TOKEN" \
        --no-progress-meter \
        'https://opensky-network.org/api/states/all?lamin=-25&lamax=-22&lomin=-47&lomax=-45' | jq -s '.'
[
  {
    "time": 1752401607,
    "states": [
      [
        "e49ef1",
        "GLO1497 ",
        "Brazil",
        1752401546,
        1752401567,
        -46.5276,
        -23.4498,
        861.06,
        false,
        75.19,
        73.3,
        -3.58,
        null,
        982.98,
        "4252",
        false,
        0
      ],
      [
        "e48c04",
        "GLO9561 ",
        "Brazil",
        1752401489,
        1752401552,
        -45.2803,
        -24.9524,
        12192,
        false,
        216.81,
        224.81,
        0,
        null,
        12755.88,
        null,
        false,
        0
      ],
      [
        "e48dae",
        "AZU6079 ",
        "Brazil",
        1752401595,
        1752401595,
        -45.7327,
        -23.8684,
        6667.5,
        false,
        180.31,
        256.64,
        -6.83,
        null,
        7063.74,
        null,
        false,
        0
      ],
      [
        "e48db1",
        "GLO1267 ",
        "Brazil",
        1752401607,
        1752401607,
        -46.5605,
        -23.4586,
        1043.94,
        false,
        65.15,
        74.43,
        -3.9,
        null,
        1188.72,
        "2630",
        true,
        0
      ],
      [
        "e49fb4",
        "AZU6010 ",
        "Brazil",
        1752401598,
        1752401600,
        -46.669,
        -23.6085,
        762,
        false,
        68.38,
        148.22,
        -4.55,
        null,
        876.3,
        "7021",
        true,
        0
      ],
      [
        "e488b1",
        "PRPSE   ",
        "Brazil",
        1752401606,
        1752401606,
        -46.4392,
        -23.0272,
        3406.14,
        false,
        165.4,
        209.44,
        -7.8,
        null,
        3589.02,
        null,
        false,
        0
      ],
      [
        "e48855",
        "GLO1969 ",
        "Brazil",
        1752401603,
        1752401606,
        -46.9303,
        -22.9436,
        4960.62,
        false,
        171.85,
        47.43,
        -8.78,
        null,
        5242.56,
        null,
        false,
        0
      ],
      [
        "e486c2",
        "TAM3341 ",
        "Brazil",
        1752401607,
        1752401607,
        -46.2123,
        -23.4107,
        3512.82,
        false,
        173.65,
        253.12,
        -4.88,
        null,
        3726.18,
        null,
        false,
        0
      ],
      [
        "e4999d",
        "TAM4692 ",
        "Brazil",
        1752401459,
        1752401459,
        -46.6612,
        -23.6214,
        null,
        true,
        3.09,
        329.06,
        null,
        null,
        null,
        null,
        false,
        0
      ],
      [
        "e49907",
        "TAM4635 ",
        "Brazil",
        1752401606,
        1752401606,
        -46.6591,
        -23.6261,
        null,
        true,
        0.32,
        236.25,
        null,
        null,
        null,
        null,
        false,
        0
      ],
      [
        "ad727c",
        "AMX014  ",
        "United States",
        1752401606,
        1752401606,
        -46.8111,
        -22.9444,
        4358.64,
        false,
        165.34,
        139.67,
        -7.8,
        null,
        4602.48,
        null,
        false,
        0
      ],
      [
        "e49b52",
        "GLO1512 ",
        "Brazil",
        1752401607,
        1752401607,
        -46.5504,
        -23.6929,
        1866.9,
        false,
        133.03,
        118.15,
        12.35,
        null,
        2011.68,
        null,
        false,
        0
      ],
      [
        "e4932a",
        "AZU2888 ",
        "Brazil",
        1752401266,
        1752401336,
        -46.547,
        -23.455,
        975.36,
        false,
        66.92,
        73.93,
        -2.93,
        null,
        1097.28,
        null,
        false,
        0
      ],
      [
        "e49104",
        "GLO2161 ",
        "Brazil",
        1752401605,
        1752401606,
        -46.5052,
        -23.1447,
        2910.84,
        false,
        142.65,
        206.1,
        -5.53,
        null,
        3093.72,
        null,
        false,
        0
      ],
      [
        "e48502",
        "GLO1635 ",
        "Brazil",
        1752401597,
        1752401599,
        -46.6268,
        -23.371,
        1706.88,
        false,
        125.58,
        203.41,
        0,
        null,
        1859.28,
        null,
        false,
        0
      ],
      [
        "e4950d",
        "GLO1631 ",
        "Brazil",
        1752401418,
        1752401418,
        -46.534,
        -23.4514,
        899.16,
        false,
        69.04,
        74,
        -3.58,
        null,
        1104.9,
        null,
        false,
        0
      ],
      [
        "e48198",
        "TAM3909 ",
        "Brazil",
        1752401606,
        1752401606,
        -45.427,
        -23.8016,
        7848.6,
        false,
        192.65,
        256.41,
        -6.5,
        null,
        8290.56,
        null,
        false,
        0
      ]
    ]
  }
]

Is this linked to the aircraft database being temporarily not functional? If so maybe a null value would be of use to keep the number of fields correct.
If not, maybe either the documentation or the API needs a fix.
I remain available for further details or tests.
Thanks for all 💯

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions