How to use Search function with query?


#1

I want to get flight information by using this ->
{range lat 36.897669 40.897669} {range lon -79.03655 -75.03655} All flights with a last reported position +/- 2 degrees of the Whitehouse

And I tried in Labview like this ->
UserID:APIkey@flightxml.flightaw … rch?query={range lat 36.897669 40.897669} {range lon -79.03655 -75.03655}&howMany=10&offset=0

Then I got that result ->
{“SearchResult”:{“next_offset”:-1,“aircraft”:]}}

I can’t get the flight information. What’s the problem?


#2

The “Search” function accepts a much more limited query string than the “SearchBirdseyeInFlight” and “SearchBirdseyePositions” functions.

The query you supplied is for the SearchBirdseye* function but you are invoking the Search function.

You can try something like this:


http://UserID:APIkey@flightxml.flightaware.com/json/FlightXML2/Search?query=-latlong "36.897669 -79.03655 40.897669 -75.03655"&howMany=10&offset=0



#3

Thank you for reply.

I tried that code but I got same result. ->

{“SearchResult”:{“next_offset”:-1,“aircraft”:]}}

Should I use the SearchBirdseye function?

I can’t get correct result.


#4

That works fine and returns results for me. Be sure that you are escaping the characters properly, if your URL request library does not automatically handle it properly for you. Here is how the fully-escaped version should look:


https://flightxml.flightaware.com/json/FlightXML2/Search?query=-latlong%20%2236.897669%20-79.03655%2040.897669%20-75.03655%22&howMany=10&offset=0

Keep in mind that there may not always be flights within the latlon box that you’re specifying so there may legitimately be 0 at some times of the day.