Hi,
I got an api key,but i’m struck in accessing the api via python. can you please guide me to to get output .
I want below information from API as output like json/xml data.
Flight number:
Date:
Source:
Destination:
Arrival date time:
Estimated Arrival date time:
Departure date:
Estimated departure date time:
Status:
Actual arrival time:
Your GET request is successful, but it’s not returning a JSON object because you’re not using the correct endpoint for the request.
The error is coming from print response.json()
because you’re not using a valid endpoint here: requests.get(fxmlUrl,params=payload,auth=(username, apiKey))
You need to use https://flightxml.flightaware.com/json/FlightXML3/FlightInfoStatus, not just https://flightxml.flightaware.com/json/FlightXML3/