Search code examples
apierror-handlingsdkamadeus

How to make requests to Amadeus API? Got Network Error


I've just registered my test app and got Api key and Api secret. I'm trying to send request using Python SDK:

from amadeus import Client, ResponseError

amadeus1 = Client(
client_id='my_API_key_here',
client_secret='my_secret_key_here'
)

response = amadeus1.reference_data.locations.airports.get(longitude=49.000, latitude=2.55)
print(response.data)

I receive Network Error. What am I doing wrong?


Solution

  • EDIT:

    The problem came from an SSL certificate issue on the dev environment.


    I cannot reproduce the problem, the API seems to work. Your example returns an empty array because the data in the test environment are limited. For this API the countries covered are: United States, Spain, United Kingdom, Germany & India.

    So if you try with London's geolocation

    response = amadeus1.reference_data.locations.airports.get(longitude=0.1278, latitude=51.5074)

    As you can see, the response contains data.

    But I don't have a Network issue. If you still face the issue please contact our support through our portal, share your username so we can check your API Key and API Secret.