SDK
import { createVoyantDataClient } from "@voyant-travel/data-sdk";
const data = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await data.hotels.tripadvisor.searches.list();curl --request GET \
--url https://api.voyant.travel/data/hotels/v1/tripadvisor/searches \
--header 'Authorization: Bearer <token>'const response = await fetch("https://api.voyant.travel/data/hotels/v1/tripadvisor/searches", {
method: "GET",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.voyant.travel/data/hotels/v1/tripadvisor/searches",
headers={
"Authorization": "Bearer <token>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/data/hotels/v1/tripadvisor/searches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.voyant.travel/data/hotels/v1/tripadvisor/searches"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.voyant.travel/data/hotels/v1/tripadvisor/searches")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/data/hotels/v1/tripadvisor/searches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"request": {},
"completedAt": "2023-11-07T05:31:56Z",
"result": {},
"cost": {
"credits": 123
},
"error": {
"code": "<string>",
"message": "<string>"
},
"webhook": {
"url": "<string>",
"deliveredAt": "2023-11-07T05:31:56Z",
"attempts": 123,
"lastError": "<string>"
}
}
],
"totalCount": 123,
"nextCursor": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}Hotels
List TripAdvisor hotel search jobs
List submitted TripAdvisor (hotel-scoped) search jobs. Requires scope data:hotels:read.
GET
/
data
/
hotels
/
v1
/
tripadvisor
/
searches
SDK
import { createVoyantDataClient } from "@voyant-travel/data-sdk";
const data = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await data.hotels.tripadvisor.searches.list();curl --request GET \
--url https://api.voyant.travel/data/hotels/v1/tripadvisor/searches \
--header 'Authorization: Bearer <token>'const response = await fetch("https://api.voyant.travel/data/hotels/v1/tripadvisor/searches", {
method: "GET",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.voyant.travel/data/hotels/v1/tripadvisor/searches",
headers={
"Authorization": "Bearer <token>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/data/hotels/v1/tripadvisor/searches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.voyant.travel/data/hotels/v1/tripadvisor/searches"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.voyant.travel/data/hotels/v1/tripadvisor/searches")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/data/hotels/v1/tripadvisor/searches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"request": {},
"completedAt": "2023-11-07T05:31:56Z",
"result": {},
"cost": {
"credits": 123
},
"error": {
"code": "<string>",
"message": "<string>"
},
"webhook": {
"url": "<string>",
"deliveredAt": "2023-11-07T05:31:56Z",
"attempts": 123,
"lastError": "<string>"
}
}
],
"totalCount": 123,
"nextCursor": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}⌘I