Skip to main content

Search API

The Search API provides a GraphQL interface to travel offers in an index. You can access the GraphQL endpoint using the following URL: https://qapi.qtravel.ai/graphql

Authentication

The Search 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]);

Search query basic example

Search query basic example The following GraphQL query searches for all offers that are relevant to the client query wycieczki do Egiptu. It retrieves the count of all offers found and for each offer, its id, name and terms.

query {
search(
countryCode: PL
languageCode: PL
filters: {
query: "wycieczki do Egiptu"
}
) {
count
offers {
id
name
terms {
period
basePrice
maintenances {
sourceName
}
departureCity
departureDate
}
}
}
}

Search query basic example response

{
"data": {
"search": {
"count": 12,
"offers": [
{
"id": "80",
"name": "Hotel Strand Taba Heights Beach & Golf Resort",
"terms": [
{
"period": 7,
"basePrice": 3000,
"maintenances": [
{
"sourceName": "Ultra All Inclusive"
}
],
"departureCity": "Warszawa Chopin",
"departureDate": "2024-11-11"
}
]
},
{
"id": "104",
"name": "Hotel Jungle Aqua Park",
"terms": [
{
"period": 5,
"basePrice": 4500,
"maintenances": [
{
"sourceName": "All Inclusive"
}
],
"departureCity": "Warszawa Chopin",
"departureDate": "2025-04-25"
}
]
},
{
"id": "184",
"name": "Tropitel Waves Naama Bay",
"terms": [
{
"period": 7,
"basePrice": 4250,
"maintenances": [
{
"sourceName": "All Inclusive"
}
],
"departureCity": "Katowice",
"departureDate": "2024-12-30"
}
]
},
]
}
}
}

Search query advanced example

query {
search (
countryCode: PL,
languageCode: PL,
order: SCORE_DESC,
filters: {
query: "szukam urlopu na majówkę hotel dla 2 osób z aquaparkiem jacuzzi siłownią w Turcji lub Grecji wylot z warszawy na 4 dni z all inclusive",
adults: 2,
children: 0,
periodRange: {
min: 3,
max: 21
}
}
pagination: {
offset: 0,
limit: 10
},
) {
count
offers {
id
name
terms {
period
basePrice
maintenances {
sourceName
}
departureCity
departureDate
}
}
facets{
countrySourceName {
value
minPrice
maxPrice
medianPrice
countOffers
}
}
}
}

Search query advanced example response

{
"data": {
"search": {
"count": 1,
"offers": [
{
"id": "10",
"name": "Maxx Royal",
"terms": [
{
"period": 4,
"basePrice": 34319,
"maintenances": [
{
"sourceName": "Ultra All Inclusive"
}
],
"departureCity": "Warszawa Chopin",
"departureDate": "2025-05-03"
}
]
}
],
"facets": {
"countrySourceName": [
{
"value": "Turcja",
"minPrice": 34319,
"maxPrice": 34319,
"medianPrice": 34319,
"countOffers": 1
}
]
}
}
}
}