Code Monkey home page Code Monkey logo

Comments (5)

anthonyroux avatar anthonyroux commented on June 15, 2024

Hi,

Regarding Flight Cheapest Date Search: in the test environment, we offer only a subset of the data we have in production. You can find the list of supported origin-destination here.

In production, we offer more origin-destination but the Flight Cheapest Date Search is an inspiration API built on top of a cache: you can search only a maximum of 6 months in advance, for a maximum trip duration of 15 days.

As you can see in the data-collection we offer some DFW -> destinations but not DFW -> LHR. I played around with the API in test and I can confirm it works fine if you use data available in test. We fully understand that you want to try the API in the test environment before moving to production, this is why we offer a free of charge access but limited. Note that even if you get access to production, we offer the same free quota in production that we offer in the test environment (every month!). In general, keep in mind that this API is an inspiration API built on top of a cache. We are working to increase the coverage of this cache (both in test and in production) but in any case, you will have to call the Flight Offers Search API to get accurate data and full coverage.

I tried the Python SDK and it works fine as well, please find below an example ready to use (just replace your API KEY & API SECRET:

from amadeus import Client, ResponseError

amadeus = Client(client_id='API_KEY',  client_secret='API_SECRET')

try:
    response = amadeus.shopping.flight_dates.get(origin='DFW', destination='EDI')
    print(response.data)
except ResponseError as error:
    raise error

There is an easy way to get the different destinations available from an origin:

  • Call first the Flight Inspiration API (here with DFW as origin)
  • Get the list of destinations available for DFW
  • Use this list in the cheapest date search

Regarding your point 1 I tried that piece of code with the latest version of our SDK and it works perfectly fine. Please find below the full working example:

from amadeus import Client, ResponseError

amadeus = Client(client_id='API_KEY',  client_secret='API_SECRET')
try:
    response = amadeus.shopping.flight_offers.get(origin='DFW', destination='DOH', departureDate='2020-12-12')
    print(response.data)
except ResponseError as error:
    raise error

Please make sure you have an updated version fo the SDK, if it is the case it might be related to your working environment/code.

My last comment: in your example, you use the Flight Low-fare Search API, this API will be decommissioned in the coming months, I strongly recommend you to use the Flight Offers Search API instead (it offers more content/capabilities and a better API design). The API is available in the Python SDK.

Hope it clarifies.

Regards,
Anthony

from amadeus-python.

baqwas avatar baqwas commented on June 15, 2024

Thx @anthonyroux for the prompt update. Understand the deprecation of the call I used to illustrate my JavaScript challenges. The Flight Offers Search works fine for me in my Jupyter notebook where I have tested all the Air related calls.

Based on your recommendation, I look forward to moving to the Production environment shortly since the pricing is pro-rated and I will only make a few daily calls to a subset of the Air services. The Node-RED approach was intended to send notifications to my Home Automation dashboard. I guess I'll do a half-and-half solution initially in the Production environment.

Understand your comments about the test data and I have no issue on that aspect.

Kind regards.

from amadeus-python.

anthonyroux avatar anthonyroux commented on June 15, 2024

Great! Make sure you monitor carefully the number of API calls you do per month (you can use the dashboard in your workspace).

We are always happy to hear what our users build using our APIs, let us know how it goes and if you would like to share more :)

Cheers,
Anthony

from amadeus-python.

jasisz avatar jasisz commented on June 15, 2024

@anthonyroux I got the same on the production environment, e.g.: I can't get any results for WAW->LON, while LON->WAW works fine.
Is there any list of workin connections for production as this one seems to be for testing env https://github.com/amadeus4dev/data-collection/blob/master/data/flightsearch.md ?

from amadeus-python.

anthonyroux avatar anthonyroux commented on June 15, 2024

Hey @jasisz, this is because we have selected LON -> WAW as an "important" segment whereas WAW -> LON was not.

The test environment is based on a subset of the production data. In case you want to see what data is available in test please refer to the test [data collection on GitHub][

Flight Cheapest Date Search and Flight Inspiration Search are inspirational APIs, we build a cache on pre-selected sets of origin-destination this is why even in production you will not find every route. If you want to get access to all routes you need to use the live search Flight Offers Search. We are actually working on a new version of the cache used by Flight Cheapest Date that will offer better data in test and in production (and a smarter coverage). As of today, we do not provide the list of routes available in production, this is something we are discussing for the new version of the cache.

from amadeus-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.