FlightAware Discussions

Offset not working on XLM2 Paid Sub

Hello and thanks for any help sorting this out.

Punch line is I can’t get the “offset” to work right and keep getting the same 15 records. I have been through the boards searching on the “offset” and “next_offset” and understand the next search queries are based on the “next_offset” received from the prior query. I have a paid xml2 account, so I should not be limited to 15 records.

Here are the first two sets of queriers and results… all looks correct in my URL formatting, but I consistently get the same results for both queries. What am I doing wrong here?
(I have truncated the result for ease, I am happy to supply the full results.)

URL 1:
http://XX:XXX@flightxml.flightaware.com/json/FlightXML2/Search?query=-latlong%20{36.79%20-123.21%2038.45%20-121.55}&howMany=15&offset=0-inAir%20{1}

Result:
{“SearchResult”:{“next_offset”:15,“aircraft”:[{“faFlightID”:“N11970-1606685648-adhoc-0”,“ident”:“N11970”,“prefix”:"",“type”:"",“suffix”:"",“origin”:“L 38.30556 -122.38083”,“destination”:"—",“timeout”:“timed_out”,“timestamp”:1606685648,“departureTime”:1606685648,“firstPositionTime”:1606685648,“arrivalTime”:0,“longitude”:-122.38083,“latitude”:38.30556,“lowLongitude”:-122.38083,“lowLatitude”:38.30556,“highLongitude”:-122.38083,“highLatitude”:38.30556,“groundspeed”:109,“altitude”:49,“heading”:0,“altitudeStatus”:"-",“updateType”:“TZ”,“altitudeChange”:"-",“waypoints”:""},{“faFlightID”:“N990WY-1606682851-adhoc-0”,“ident”:“N990WY”,“prefix”:"",“type”:“CH7A”,“suffix”:"",“origin”:“KRHV”,“destination”:"—",“timeout”:“timed_out”,“timestamp”:1606686036,“departureTime”:1606682884,“firstPositionTime”:1606682884,“arrivalTime”:0,“longitude”:-121.80857,"latitude”:…

URL 2:
http://XX:XXX@flightxml.flightaware.com/json/FlightXML2/Search?query=-latlong%20{36.79%20-123.21%2038.45%20-121.55}&howMany=15&offset=15-inAir%20{1}

Result:
{“SearchResult”:{“next_offset”:15,“aircraft”:[{“faFlightID”:“N11970-1606685648-adhoc-0”,“ident”:“N11970”,“prefix”:"",“type”:"",“suffix”:"",“origin”:“L 38.30556 -122.38083”,“destination”:"—",“timeout”:“timed_out”,“timestamp”:1606685648,“departureTime”:1606685648,“firstPositionTime”:1606685648,“arrivalTime”:0,“longitude”:-122.38083,“latitude”:38.30556,“lowLongitude”:-122.38083,“lowLatitude”:38.30556,“highLongitude”:-122.38083,“highLatitude”:38.30556,“groundspeed”:109,“altitude”:49,“heading”:0,“altitudeStatus”:"-",“updateType”:“TZ”,“altitudeChange”:"-",“waypoints”:""},{“faFlightID”:“N990WY-1606682851-adhoc-0”,“ident”:“N990WY”,“prefix”:"",“type”:“CH7A”,“suffix”:"",“origin”:“KRHV”,“destination”:"—",“timeout”:“timed_out”,“timestamp”:1606686036,“departureTime”:1606682884,“firstPositionTime”:1606682884,“arrivalTime”:0,“longitude”:-121.80857,"latitude”:…

You have this part in the wrong place. The -inAir needs to be part of the query parameter, not part of the offset parameter.

The correct full URL should be something like:
http://XX:XXX@flightxml.flightaware.com/json/FlightXML2/Search?query=-latlong%20{36.79%20-123.21%2038.45%20-121.55}%20-inAir%201&howMany=15&offset=15

However, I would recommend trying to get all of your results in a single request (by using a larger howMany argument), because the data from Search and SearchBirdseye* tends to be very volatile between calls.

Thank you for the quick response. VERY HELPFUL. I made the change and it’s working.