Comments (1)
Hi,
Thanks for raising this issue, you are right the description of this parameter is not clear at all, the team is going to change it.
maxFlightTime
is a bit complex and not easy to use (this feature is mainly used by big travel agencies...). The number is a percentage expressing how much longer you are ready to accept the flight duration to be, as compared to the shortest flight that exists for this search criteria, not very clear right?
Let's take an example:
We are looking for a flight from MAD
to SFO
(and we are returning only 1 offer for the sake of the example) using the POST endpoint of Flight Offers Search:
JSON Body:
{
"currencyCode": "EUR",
"originDestinations": [
{
"id": "1",
"originLocationCode": "MAD",
"destinationLocationCode": "SFO",
"departureDateTimeRange": {
"date": "2021-05-01",
"time": "10:00:00"
}
}
],
"travelers": [
{
"id": "1",
"travelerType": "ADULT",
"fareOptions": [
"STANDARD"
]
}
],
"sources": [
"GDS"
],
"searchCriteria": {
"maxFlightOffers": 1,
"flightFilters": {
"cabinRestrictions": [
{
"cabin": "ECONOMY",
"coverage": "MOST_SEGMENTS",
"originDestinationIds": [
"1"
]
}
]
}
}
}
If you check the JSON response you will see that the offer is MAD
to IST
(duration PT4H15M
so 4h15) and IST
to SFO
(duration PT13H20M
so 13h20M) so in total duration of 17h35. Note that this API always returns the cheapest flight offers for the given criteria.
If now we want to do the same request adding maxFlightTime
but we don't want to have such a long trip, we want to have a maximum total duration of 110% longer than the shortest flight available.
We can use this JSON body
{
"currencyCode": "EUR",
"originDestinations": [
{
"id": "1",
"originLocationCode": "MAD",
"destinationLocationCode": "SFO",
"departureDateTimeRange": {
"date": "2021-05-01",
"time": "10:00:00"
}
}
],
"travelers": [
{
"id": "1",
"travelerType": "ADULT",
"fareOptions": [
"STANDARD"
]
}
],
"sources": [
"GDS"
],
"searchCriteria": {
"maxFlightOffers": 1,
"flightFilters": {
"maxFlightTime": 110,
"cabinRestrictions": [
{
"cabin": "ECONOMY",
"coverage": "MOST_SEGMENTS",
"originDestinationIds": [
"1"
]
}
]
}
}
}
This is the response you will get:
MAD
to DFW
for a duration of PT10H35M
(10h35) and then DAL
(another Dallas Airport?) to SFO
for a duration of
PT4H4M
(4h04) so a total duration of 14h39.
This is why maxFlightTime
can only be between 100 and 999.
I hope it clarifies a bit how this works (I do agree it is not easy to understand and we will update the API documentation very soon).
I have raised a question to the API development team about why using 100
in my example doesn't return any flight, I would have expected to have the shortest flight available. I will keep you informed when I have more information.
Don't hesitate if you need more explanations.
from amadeus-ruby.
Related Issues (20)
- Add support for Trip Parser API
- Add support for Hotel Ratings API
- Add support for Flight Offers Search API
- Add support for Flight Offers Price API
- Add support for Flight Create Orders API
- Add support for Trip Purpose Prediction API
- E_reputation not working HOT 1
- hotel_offers_by_hotel not working properly HOT 2
- Add support for the retrieve endpoint of Points of Interest
- .post works only with JSON not hash
- Add support for Safe Place API
- Pagination documentation needs improvement HOT 2
- Add support for Flight Availabilities Search API
- Add support for Branded Fares Upsell API
- Add support for Travel Restrictions API HOT 1
- Add support for Airport Routes V1
- Add Support of Hotel List V1.0 API
- Add support of City Search API V1.0
- Add support of Travel Restrictions V2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amadeus-ruby.