Response mapping index
With the new v3 the response object has changed around a lot so this guide will explain all the changes and help you navigate the new structure.
Important differences
rating&ratingBreakdownproperties have been added which give a rating (partner quality score) based on travellers booking experience feedback- Itineraries now are unordered, you can utilize
sortingOptionsto order flights. sustainabilityDatais available through an opt-in parameterincludeSustainabilityData. You can check more information here.Currencieshave been removed from the response data.- Changed a lot of objects types to be maps in
v3instead of arrays inv1.0. - The structure of the response has now changed, with the main content under
content.resultsinstead ofqueryobject - All properties in the response now are formatted with camelCase instead of an PascalCase . For example
PricingOptionshas becomepricingOptions. - Dates have now changed from a string value
2023-01-20T16:45:00to a Date object. - We have the following new fields
Response Data Structure
Since the data response structure has changed, we will need a new way to retrieve and manipulate the data.
In order to get all the flights we will need to get the itineraryId from the sortingOptions based on the preferred criteria.
Here is an example where we get all best flights in Javascript.
const bestItineraryIds = response.content.sortingOptions.best.map(
(flight) => flight.itineraryId,
);
const bestItineraries = Object.keys(response.content.results.itineraries)
.filter((key) => bestItineraryIds.includes(key))
.reduce((obj, key) => {
obj[key] = response.content.results.itineraries[key];
return obj;
}, {});
New in v3
Action
action is a new field added which instructs you on how to treat the flight results in the response.
For example, if the value of the action is RESULT_ACTION_REPLACED then you should replace the previous data with the new data you received.
There are three different action values that can be in the response.
| Action v3 | Description |
|---|---|
RESULT_ACTION_REPLACED | The results contained in this response fully replace any previously received results. |
RESULT_ACTION_NOT_MODIFIED | The response contains no new results in this search session. Any previously received results for this inventory type still apply. |
RESULT_ACTION_OMITTED | Not able to provide results for the request. Therefore, the response does not contain any results and will not in a future polling operation. |
Stats
Stats provide information regarding the flights returned.
It contains the minPrice, minDurtation, maxDuration of the flights and also an aggregated object stops which contains
the data of how are direct, have 1 stop, or multiple stops.
Stats can be useful to get fastest/longest trip amongst other things.
Show stats structure
{
"stats": {
"itineraries": {
"minDuration": 605,
"maxDuration": 1990,
"total": {
"count": 10,
"minPrice": {
"amount": 147320,
"unit": "PRICE_UNIT_MILLI"
}
},
"stops": {
"direct": {
"total": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
},
"ticketTypes": {
"singleTicket": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
},
"multiTicketNonNpt": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
},
"multiTicketNpt": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
}
}
},
"oneStop": {
"total": {
"count": 8,
"minPrice": {
"amount": 884260,
"unit": "PRICE_UNIT_MILLI"
}
},
"ticketTypes": {
"singleTicket": {
"count": 8,
"minPrice": {
"amount": 884260,
"unit": "PRICE_UNIT_MILLI"
}
},
"multiTicketNonNpt": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
},
"multiTicketNpt": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
}
}
},
"twoPlusStops": {
"total": {
"count": 2,
"minPrice": {
"amount": 147320,
"unit": "PRICE_UNIT_MILLI"
}
},
"ticketTypes": {
"singleTicket": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
},
"multiTicketNonNpt": {
"count": 0,
"minPrice": {
"amount": 0,
"unit": "PRICE_UNIT_UNSPECIFIED"
}
},
"multiTicketNpt": {
"count": 2,
"minPrice": {
"amount": 147320,
"unit": "PRICE_UNIT_MILLI"
}
}
}
}
},
"hasChangeAirportTransfer": false
}
}
}
Sorting options
Sorting options are used to help you sort itineraries based on your preferred criteria.
You can now sort the itineraries based on fastest,cheapest or best trips.
The sorting options now give the flexibility to sort itineraries based on your need compared to v1.0 where they were pre-ordered.
Sorting options contain the iteneraryId that can be used to filter out the flights in the itineraries object returned.
Show sortingOptions structure
{
"sortingOptions": {
"best": [
{
"score": 1,
"itineraryId": "11235-2301201930--32480-0-13554-2301202055|13554-2301211130--32480-0-11235-2301211255"
},
{
"score": 0.971871,
"itineraryId": "11235-2301201255--32480-0-13554-2301201420|13554-2301211130--32480-0-11235-2301211255"
},
},
...
],
"cheapest": [
{
"score": 1,
"itineraryId": "11235-2301201930--32480-0-13554-2301202055|13554-2301211130--32480-0-11235-2301211255"
},
...
],
"fastest": [
{
"score": 1,
"itineraryId": "11235-2301201930--32480-0-13554-2301202055|13554-2301211130--32480-0-11235-2301211255"
},
...
]
}
}
Changed in v3
Itineraries
agentIdsare now in string format.- The outbound / inbound leg is now listed as the key of the object, separated by a
| - There is now a
faresobject that will givebookingCodeandfareBasisCode, linked to a segment. deeplinkis an Impact link now.
info
Adding unique identifier to a deeplink
If you want to add a unique identifier to an Impact deeplink, you can do it by adding a p.auid and sharedid query parameter at the end of the link.
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Legs
Legs show the details of an itinerary. Every key of the object is an itineraryId.
- There is no longer a directionality outbound/inbound for legs, and FlightNumbers have been moved to segments.
Directionalityhas been removedFlightNumbershas been moved to segments
Also, the departureDateTime and arrivalDateTime is now an object.
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Segments
Note that segmentId is now the key of the object 13554-11235-2301211640-2301211805--32480.
Also, the departureDateTime and arrivalDateTime is now a date object.
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Places
entityIdhas been added to the places object. This is an internal id for Skyscanner.- The object now has a key which is the
entityIdvalue. Idhas been removed
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Agents
OptimisedForMobilehas been renamed toisOptimisedForMobileStatushas been removed- New
rating&ratingBreakdownproperties have been added in order to show how reliable an agent is. - New
feedbackCountproperty has been added to [placeholder]
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Carriers
Idof carrier is now moved outside as the key.Codehas been renamed toiataDisplayCodehas been removedallianceIdhas been added and points to the alliance of the carrier.
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Dates
Dates have changed from string values to an object.
Here is the new structure of dates in v3.
Here is the new structure in v3 compared to v1.0.
| v1.0 (before) | v3 (after) |
|---|---|
| |
Layout
See the layout of the response in the API reference.