Getting flight arrival and departure by inputs airline and departure date


I am trying to use FlightAware API to get the flights arrival and departure by specifing airline company and departure date as inputs.
Inputs - Airline company and departure date
Output - Arrival and departure of flights

What are the API methods should i use to expect result ?
I am using FlightXML2 as part of API usage. Appreciate you help.


I am using XML3, but I think you can apply my method to XML2 if needed.

First step: you use the airline code and the date to request the schedule:

username = dataiku.get_custom_variables()["API_USER"]
apiKey   = dataiku.get_custom_variables()["API_KEY"]
fxmlUrl  = dataiku.get_custom_variables()["fxmlUrl"]
list_of_flights = []
next_offset = -1

payload = {'start_date' : str(t1), 'end_date' : str(t2), 'airline' : airline, 'exclude_codeshare' : 'True',
    'howMany':'150', 'offset' : '0'}
response = requests.get(fxmlUrl + "AirlineFlightSchedules",
    params=payload, auth=(username, apiKey))

Second step: (optional)
for each flight number you are interested in, you request the FlightInfoStatus.

The image is taken from dataiku DSS, which is what I use to do all my analysis. The pyhton symbols represent code recipes.