Search code examples
amadeus

Data freshness in production


I would like to know about the freshness of Inspirationnal search and flightOfferSearch endpoint.

I would like to implement some caching mechanism for performance and to not make redundant call to your api when not required.

how many time could I put the inspirationnal Search and flightOffer Search response in cache before refreshing the results ?


Solution

  • Flight Inspiration Search: The API is built on top of a cache, you can cache those prices on your side as they are not refreshed all the time. Regarding how often you should refresh the cache: there is no golden rule, some prices/availabilities are refreshed a few times a day, some once a day or every few hours... In any case, this is an inspirational API, you should always call Flight Offers Search when you select one of the offer returned by Flight Inspiration Search to get the latest price/availability.

    Flight Offers Search: This API doesn't have a cache, you get the latest prices and availabilities every time you call the API. Prices and availabilities in flights are changing quite a lot and there is no specific rule to ensure you have the updated data (the only ways are to either call the search again or to call Flight Offers Price to refresh a specific list of flight offers). You can build a cache but you will have to refresh it very often if you want accurate data.

    Note: You are allowed to cache only to improve the performances of your solution, not to store and resell the data.