Filter List API
Filter List Arguments
Use the filterList
operation to retrieve available filters. This operation is not publicly accessible and requires authentication. Include a generated token in the request header to authenticate
Authentication
The Filter List API is not publicly available and requires authentication. Authentication is managed through an authentication token. This token can be retrieved from the Qtravel Dashboard Search Settings. Any client using the API needs to provide the token in the request header:
Authorization: Bearer {QAPI_TOKEN}
Forward user IP addresses
To ensure that inaccurate analysis does not occur, you must add an X-Forwarded-For
header with your IP address to the request
Example implementation in React App
const authLink = setContext((_, { headers }) => {
// get the authentication token fromauthorization: token ? `Bearer local storage if it exists
const token = localStorage.getItem("qapiToken"); // localStorage.getItem("token");
// return the headers to the context so httpLink can read them
return {
headers: {
...headers,
authorization: token ? `Bearer ${token}` : "",
'X-Forwarded-For': 'XX.XXX.XXX.XXX'
},
};
});
const link = ApolloLink.from([authLink, httpLink]);
Filter List query basic example
query {
filterList (
countryCode: PL,
languageCode: PL,
) {
adults {
count
avgPrice
count
countOffers
maxPrice
medianPrice
minPrice
value
}
}
}
Filter List query basic example response
{
"data": {
"filterList": {
"adults": [
{
"count": 9168,
"avgPrice": 5311,
"countOffers": 143,
"maxPrice": 35800,
"medianPrice": 3958,
"minPrice": 1185,
"value": 2
},
{
"count": 4992,
"avgPrice": 8773,
"countOffers": 55,
"maxPrice": 34319,
"medianPrice": 7000,
"minPrice": 1000,
"value": 3
},
{
"count": 2888,
"avgPrice": 4911,
"countOffers": 21,
"maxPrice": 9500,
"medianPrice": 5500,
"minPrice": 1250,
"value": 4
},
{
"count": 1049,
"avgPrice": 2478,
"countOffers": 8,
"maxPrice": 7399,
"medianPrice": 2227,
"minPrice": 2227,
"value": 1
}
]
}
}
}