SDK
import { createVoyantDataClient } from "@voyant-travel/data-sdk";
const data = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await data.geo.places.get("<id>");curl --request GET \
--url https://api.voyant.travel/data/geo/v1/places/<id> \
--header 'Authorization: Bearer <token>'const response = await fetch("https://api.voyant.travel/data/geo/v1/places/<id>", {
method: "GET",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.voyant.travel/data/geo/v1/places/<id>",
headers={
"Authorization": "Bearer <token>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/data/geo/v1/places/{id}",
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/geo/v1/places/{id}"
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/geo/v1/places/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/data/geo/v1/places/{id}")
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>",
"type": "region",
"unlocode": "<string>",
"countryIso2": "<string>",
"parentId": "<string>",
"coordinates": {
"lat": 123,
"lng": 123
},
"name": "<string>",
"nameLang": "<string>",
"names": {},
"aliases": [
"<string>"
],
"attributes": {}
},
"relations": {}
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}Geo
Get a place with its relations
Fetch a single canonical place plus its outgoing relations grouped by kind. Requires scope data:geo:read.
GET
/
data
/
geo
/
v1
/
places
/
{id}
SDK
import { createVoyantDataClient } from "@voyant-travel/data-sdk";
const data = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await data.geo.places.get("<id>");curl --request GET \
--url https://api.voyant.travel/data/geo/v1/places/<id> \
--header 'Authorization: Bearer <token>'const response = await fetch("https://api.voyant.travel/data/geo/v1/places/<id>", {
method: "GET",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.voyant.travel/data/geo/v1/places/<id>",
headers={
"Authorization": "Bearer <token>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/data/geo/v1/places/{id}",
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/geo/v1/places/{id}"
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/geo/v1/places/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/data/geo/v1/places/{id}")
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>",
"type": "region",
"unlocode": "<string>",
"countryIso2": "<string>",
"parentId": "<string>",
"coordinates": {
"lat": 123,
"lng": 123
},
"name": "<string>",
"nameLang": "<string>",
"names": {},
"aliases": [
"<string>"
],
"attributes": {}
},
"relations": {}
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}Authorizations
Voyant Data API token, scoped per sub-product (data:{product}:read). Sent as Authorization: Bearer <token>.
Path Parameters
⌘I