Flight XML - inconsistent pattern on the flight search

Hello Team,

I am using Flight Aware XML to track the flights, I am facing a serious issue wherein some of the flights are not returned in the search.
Please study my cases that I did as tests, and let me know the issue.

Say I am searching for a flight of LIAT airlines, for 24th of April, I am using the function → AirlineFlightSchedules to do the search:

Case1: USE ONLY 24TH AS THE SEARCHED DATE

$start_date = strtotime(“2016-04-24 00:00:00”);
$end_date = strtotime(“2016-04-24 23:59:59”);

$params = array(“startDate”=>$start_date,“endDate”=>$end_date,“origin”=>$origin,“destination”=>$destination,“airline”=>$airline,“flightno”=>$flightno,“howMany”=>$howMany,“offset”=>$offset);pr($params);
$result = $client->AirlineFlightSchedules($params);

My Array becomes :

Array
(
[startDate] => 1461456000
[endDate] => 1461542399
[origin] =>
[destination] => STT
[airline] => LIA
[flightno] =>
[howMany] => 50
[offset] => 1
)

I know there is a flight for 24th for LIAT, coming to st thomas (STT), but according to my array above, it did not give me any result.
Result - FAILED

Case2:USE A DATE RANGE FROM 21ST TO 24TH

$start_date = strtotime(“2016-04-21 00:00:00”);
$end_date = strtotime(“2016-04-24 23:59:59”);

[startDate] => 1461196800
[endDate] => 1461542399

My Array becomes :

Array
(
[startDate] => 1461196800
[endDate] => 1461542399
[origin] =>
[destination] => STT
[airline] => LIA
[flightno] =>
[howMany] => 50
[offset] => 1
)

If I use the above date range, I get the result for 24th.

[data] => stdClass Object
(
[ident] => LIA550
[actual_ident] =>
[departuretime] => 1461517200
[arrivaltime] => 1461519900
[origin] => TNCM
[destination] => TIST
[aircrafttype] => AT43
[meal_service] =>
[seats_cabin_first] => 0
[seats_cabin_business] => 0
[seats_cabin_coach] => 46
)

Result - PASS

Case3: USE A DATE RANGE FRO 23RD TO 24TH

$start_date = strtotime(“2016-04-23 00:00:00”);
$end_date = strtotime(“2016-04-24 23:59:59”);

[startDate] => 1461369600
[endDate] => 1461542399

My Array becomes :

Array
(
[startDate] => 1461369600
[endDate] => 1461542399
[origin] =>
[destination] => STT
[airline] => LIA
[flightno] =>
[howMany] => 50
[offset] => 1
)

If I use the above date range, I still do not get a result for 24th.

[AirlineFlightSchedulesResult] => stdClass Object
(
[next_offset] => -1
)

Result - FAILED

So, if you see my cases above, there is no pattern of how its searching for the flight for 24th, Please let me know what’s wrong here, So I can get the right results.

Looking forward for an early response.

Thanks
Amit

Hi Amit,

I see you have [offset] => 1.
Between 21st and 24th the call returns 2 flights, but the offset=1 will not return the first row to you.
Between 23rd and 24th the call returns 1 flight but you don’t see it because offset=1 will delete it for you.
So my suggestion is to try without offset.