A Python script to pull Fedex flights from SDG

Hi, I am new here and want to apply the API response to improve the delivery time by Fedex.

For example, I want to check for FedEx departures from Paris, France (the CDG airport) today and upcoming.

What endpoint(s) would fit the best?

This is the code I think may do the magic, but it does not return any FedEx flights or allow me to filter the response:

def search_flights(origin, destination, airline, start, end):
query1 = {
‘orig’: ‘LFPG’,
‘dest’: ‘KEWR’,
‘aircraftType’: ‘B763’,
‘range actualDepartureTime’: ‘2024-05-20 2024-05-29’
}
return aero_api.api_caller(aero_api._build_path(‘airports’, origin, ‘flights’, ‘to’, destination), query)

You’ll want to do a GET /flights/search with a query argument of -origin LFPG -airline FDX
For your example, it’s not necessary to specify a date range since that endpoint is only recent flights within a one-day timespan anyways.

The Python code you supplied doesn’t seem to correspond to your stated intent, since it is using the ‘airports’ endpoint to search between two airports and filtering by aircraft type not operator.

If you really want to use the airports endpoint, you can do a GET /airports/{id}/flights/departures with id of LFPG and airline of FDX.

Thank you very much!
I took the destination airport to limit the resultset
the plane type is B-763 used by FedEx once the airline was not listed (or I missed in the spec).
Anyway, giving it a try.
By any chance, so you know if it is possible to pull the historical data for at least a year for all FedEx outbound from CDG?

Thank you very much

Michael

Historical flight access via GET /history/flights/{ident} only works if you know the specific idents of the flights already, and that does not let you query just by airport+operator.

However, you can request a custom report from one of our data specialists and they can generate a CSV report for you containing just that airport+operator combination for whatever timespan you want.

Love it! I think I have got everything what I need.
Thank you!

On a side note, why you would not attach a postman collection on the site?
It is easy to generate, but works in one click.

The overview section of the documentation tells you how to load it into postman:

AeroAPI is defined using the OpenAPI Spec 3.0, which means it can be easily imported into tools like Postman. To get started try importing the API specification using Postman’s instructions. Once imported as a collection only the “Value” field under the collection’s Authorization tab needs to be populated and saved before making calls.

The AeroAPI OpenAPI specification is located at:
https://static.flightaware.com/rsrc/aeroapi/aeroapi-openapi.yml