How to get the primary carrier out of AirportBoards


#1

We’ve been using the AirportBoards endpoint to retrieve flights and then using the AirlineInfo endpoint to print out the airline shortname. But for flights with codeshares, we’d really prefer to display the primary carrier’s name instead. For example, for flight JIA5588-1517793900-schedule-0000, we used ‘PSA Airlines’ because that’s the airline code, but would’ve preferred the codeshare AAL5588’S ‘American Airlines.’ Another example is ASQ4081-1517725600-airline-0093, whose airline is ExpressJet. We’d rather display codeshare UAL4081’s United Airlines.

We don’t want to assume that the codeshare is the major airline for every flight. Unless this is the case? (Seems risky to assume until you say otherwise) Is there another endpoint we can query for the primary carrier?


#2

If you dont mind an extra call you can get this. Pull the FlightId out of AirportBoards, run that through FlightInfoStatus, which will give you the codeshare flight, then you may have to deconstruct or limit to only use the 1st 3 characters of that response to derive the shortname using AirlineInfo.

50%20PM