Skip to main content

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 in a POST request.

For query in v1, searching for ip address 212.185.186.162

curl --location --request 
GET 'https://partners.api.skyscanner.net/apiservices/autosuggest/v1.0/UK/GBP/en-GB?id=212.185.186.162-ip&apiKey=prtl6749387986743898559646983194'

The equivalent query in v3

curl --location --request POST 'https://partners.api.skyscanner.net/apiservices/v3/geo/hierarchy/flights/nearest' \
--header 'x-api-key: prtl6749387986743898559646983194' \
--header 'Content-Type: application/json' \
--data-raw '{
"locale": "en-GB",
"locator": {
"ipAddress":"212.185.186.162"
}
}'

For query in v1, searching for coordinates of Washington DC

curl --location --request 
GET 'https://partners.api.skyscanner.net/apiservices/autosuggest/v1.0/UK/GBP/en-GB?id=38.8951,-77.0364-latlong&apiKey=prtl6749387986743898559646983194'

The equivalent query in v3

curl --location --request POST 'https://partners.api.skyscanner.net/apiservices/v3/geo/hierarchy/flights/nearest' \
--header 'x-api-key: prtl6749387986743898559646983194' \
--header 'Content-Type: application/json' \
--data-raw '{
"locale": "en-GB",
"locator": {
"coordinates": {
"latitude": 38.8951,
"longitude": -77.0364
}
}
}'

The query object for the nearest places endpoint in the Geo API can be found here