/location-links
Retrieve links to the location search pages of various providers.
Endpoint URL
https://partners.api.vio.com/v1/location-links
HTTP Method
POST
Headers
Name | Required | Description |
---|---|---|
X-Partner-Key | Yes | Partner's profile key |
Content-Type | Yes | application/json |
Accept-Encoding | No | gzip, deflate, br |
Request body
API Parameters
Name | Required | Type | Description | Example Query | Default value |
---|---|---|---|---|---|
query | Yes | string | Free-text query | Amsterdam city | |
checkIn | No | string | Check in date (YYYY-MM-DD) | 2023-05-10 | |
checkOut | No | string | Check out date (YYYY-MM-DD) | 2023-05-11 | |
rooms | Yes | string | See Rooms configuration | 2:4,6 | 2 |
language | Yes | string | See supported languages | es | en |
currency | Yes | string | See supported currencies | USD | EUR |
anonymousId | No | string | Anonymous user identifier | e0775301-a95a-4b56-a727-9cec40a013af | |
userDevice | Yes | string | The type of the user's device: desktop , mobile , tablet . If not specified, the API determines it based on the caller's User-Agent header. | "desktop" | "desktop" |
userCountry | Yes | string | The 2-char ISO 3166 country code of a user. If not specified, the API determines it based on the caller's IP address. | "US" | |
vioOnly | No | boolean | Return only Vio.com location links | ||
label | No | string | Arbitrary string for tracking and reporting. | ||
place | No | jsonObject | Object for querying specific place details, including place name and country for refining searches in case of duplicate place names in different countries. | { "name": "Paris", "country": "France" } |
PlaceQuery Definition
PlaceQuery:
type: object
properties:
country:
type: string
description: |
Country of the place. Use this parameter to refine the search if there are places (e.g. cities) with the same names in different countries.
If the "name" parameter value is the country itself, then this parameter can be ignored.
name:
type: string
description: The name of the place to query.
required:
- name
Dynamic Click Tracking
Click tracking is available using Dynamic Click Tracking
Example
- Bash
- Javascript
- Python
curl --request POST 'https://partners.api.vio.com/v1/location-links' \
--header 'X-Partner-Key: partner-profile-key' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-03-19",
"checkOut": "2023-03-20",
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "ES",
"userDevice": "mobile",
"query": "Madrid, Spain"
}'
curl --request POST 'https://partners.api.vio.com/v1/location-links' \
--header 'X-Partner-Key: partner-profile-key' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-03-19",
"checkOut": "2023-03-20",
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "GB",
"userDevice": "desktop",
"place": {
"name": "Madrid",
"country": "Spain"
}
}'
const url = "https://partners.api.vio.com/v1/location-links";
const key = "partner-profile-key";
const requestBody = {
checkIn: "2023-03-19",
checkOut: "2023-03-20",
rooms: "2",
language: "en",
currency: "EUR",
userCountry: "NL",
userDevice: "mobile",
query: "Madrid, Spain",
};
const headers = {
"Content-Type": "application/json",
"X-Partner-Key": key,
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(requestBody),
})
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
}
return response.json();
})
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://partners.api.vio.com/v1/location-links"
key = "partner-profile-key"
request_body = {
"checkIn": "2023-03-19",
"checkOut": "2023-03-20",
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "ES",
"userDevice": "mobile",
"query": "Madrid, Spain"
}
headers = {
"Content-Type": "application/json",
"X-Partner-Key": key
}
response = requests.post(url, headers=headers, json=request_body)
if response.status_code != 200:
raise Exception("Request failed with status code {}".format(response.status_code))
response_data = response.json()
print(response_data)
Response
The response payload has the following fields:
Field | Type | Description |
---|---|---|
links | ProviderLinks[] | A List of providers links. |
ProviderLinks
Field | Type | Description |
---|---|---|
name | string | Provider's name. |
logo | string | Provider's logo. |
url | string | Book url. |
Example:
{
"name": "Vio.com",
"logo": "https://i.fih.io/provider/svg/fht.svg",
"url": "https://r.vio.com/..."
}
Live demos
Redirect banner with location based links
This is an example of how the /v1/location-links
endpoint can be used to create an inline banner with redirect links to different providers.