FlightAware Discussions

Get the airline name based on flight number.

Hi, I am trying to fetch airline name based on flight number. I searched all through the documents and it seems like the way I can get airline name is after passing ICAO code to airlineInfo query. I am having users enter flight number and I don’t expect them to know the ICAO code. Kind of frustrated right now the way data sets are returned without airline name. Please can anyone point me to right direction? I appreciate the help and time.
Thank you very much!

Multiple airlines have the same flight number. Why not offer your users a list of airlines that they can enter and then have coding that would pull up the flight?

You can use AllAirlines and AirlineInfo to retrieve the names and codes of all of the airlines in advance and cache that information. Then your users can pick or autocomplete their entries from that list.

Alternatively, if you are doing a flight number search based specifically at an airport, you can use the Scheduled/Enroute/Arrived/Departed functions to retrieve flights involving that airport and then try to match that flight number with any of the idents that are returned. You would probably also want to cache that information in advance. (However that will not match codeshare flights that operate with a different number. You will need to call AirlineFlightInfo on each flight to determine what codeshares they have.)