Which api to get the latest flight state

Dear all:
1.Which api should i use to get the latest flight state like ontime,delay,departure or canceled except use setAlert,input flightno and flightdate to get the state.
2.when i use AirlineFlightSchedules api ,my flightno has two destination like MU588 from JFK to PVG to FOC.

input:
$params = array(“startDate” => 1577404800,“endDate”=>1577491200,“origin”=>“”,“destination”=>“”,“airline”=>$airline,“flightno”=>‘MU588’,“howMany”=>2,“offset”=>0)
return:
repeat data from JFK to PVG

when change howMang to 3,return two repeat data from JFK to PVG and one data from PVG to FOC.
what does this happen,please help me,thank you.

  1. If you have a an ident and departure time from AirlineFlightSchedules the values can be passed to GetFlightID up to 24 hours in advance of the departure time. This will return the faFlightID, a value tha can be used to uniquely identify that specific flight for it’s entire duration. If this value is used as the ident in SetAlert then alerts will only be sent for the specific flight. It can also be used in FlightInfoEx to retrieve status on demand.

  2. FlightAware tracks flight per leg (one takeoff and landing). MU588 is two legs ticketed under one flight number. This will be tracked as two flights in our system, each with it’s own origin and destination pair.

Thank you for your response, but I can only get data from FlightInfoEx within two days,now I want to get the data of BK3164 5,Jan,2020. This flight has been cancalled but i cant know its status when I use FlightInfoEx this time. SetAlert has same problem.How can i achieve it.

$Flightinfoparams=array(“ident”=>“OKA3164@1578214800”,“howMany”=>1,“offset”=>0);
$Flightinforesult=$client->FlightInfoEx($Flightinfoparams);