Amadeus API - "ORIGIN AND DESTINATION NOT SUPPORTED" Error

99 views Asked by At

I'm trying to use the Amadeus API to retrieve cheap flight information between two airports that are listed as available for testing in their API documentation. However, I'm encountering the following error:

{"errors":[{"status":500,"code":141,"title":"SYSTEM ERROR HAS OCCURRED","detail":"ORIGIN AND DESTINATION NOT SUPPORTED"}]}

Below is the code snippet I'm using:

if access_token:
    url = "https://test.api.amadeus.com/v1/shopping/flight-dates"

    params = {
        "origin": "BER", 
        "destination": "AUH",
    }

    headers = {
        "Authorization": f"Bearer {access_token}"
    }

    response = requests.get(url, params=params, headers=headers)

I've verified that both "BER" and "AUH" are valid IATA codes, and they are listed in the Amadeus API documentation as available for testing. Can anyone help me understand why I'm getting this error and how to resolve it?

2

There are 2 answers

0
z0rd On

I just found that the list isn't being updated for years - for those who are willing to test, BKK x CNX is working.

0
anna_ts On

The API is built on top of a per-computed cache this is why, even in production, you don't return all possible options. The API computes every day the most trending options based on past searches and bookings and fills the cache, which means that the cache is dynamic.