Step 3 - Query data
Update query
To send query data you now need to pass it in the body in JSON format application/json instead of passing them in the URL.
You do this by passing through a query object. This is an example of query data passed in the search request
curl --location --request POST 'https://partners.api.skyscanner.net/apiservices/v3/flights/indicative/search' \
--header 'x-api-key: prtl6749387986743898559646983194' \
--header 'Content-Type: application/json' \
--data-raw '{
"query": {
"market": "UK",
"locale": "en-GB",
"currency": "GBP",
...
}
}'
In v3 there is a new query object that is used to search for your flights. You will need to build out this object based on your needed search criteria.
info
What is the Query object
You can find a full explanation of the query object. Query object guide
Here is a sample of a query object:
{
"query": {
"currency": "GBP",
"locale": "en-GB",
"market": "UK",
"queryLegs": [
{
"destinationPlace": {
"queryPlace": {
"iata": "EDI" // The IATA code for the "Edinburgh" airport
}
},
"originPlace": {
"queryPlace": {
"iata": "LHR"
}
},
"fixedDate": {
"year": 2022,
"day": 11,
"month": 8
}
}
],
"dateTimeGroupingType": "DATE_TIME_GROUPING_TYPE_BY_DATE"
}
}