SDK
import { createVoyantDataClient } from "@voyant-travel/data-sdk";
const data = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await data.geo.places.search({ q: "..." });curl --request GET \
--url https://api.voyant.travel/data/geo/v1/places/search \
--header 'Authorization: Bearer <token>'const response = await fetch("https://api.voyant.travel/data/geo/v1/places/search", {
method: "GET",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.voyant.travel/data/geo/v1/places/search",
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/search",
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/search"
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/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/data/geo/v1/places/search")
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": {}
}
],
"totalCount": 123,
"nextCursor": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}Geo
Search places by name
Search / autocomplete canonical places by name. Matches a prefix (at least 2 characters) of the primary name and of every alias (translations, exonyms, alternate names), optionally restricted to a country and to a set of types. Results are ranked exact match before prefix match, then countries and regions, then population (largest first), then type priority (country, region, subdivision, island, area, city, port, waterways). Requires scope data:geo:read.
GET
/
data
/
geo
/
v1
/
places
/
search
SDK
import { createVoyantDataClient } from "@voyant-travel/data-sdk";
const data = createVoyantDataClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await data.geo.places.search({ q: "..." });curl --request GET \
--url https://api.voyant.travel/data/geo/v1/places/search \
--header 'Authorization: Bearer <token>'const response = await fetch("https://api.voyant.travel/data/geo/v1/places/search", {
method: "GET",
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.voyant.travel/data/geo/v1/places/search",
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/search",
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/search"
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/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/data/geo/v1/places/search")
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": {}
}
],
"totalCount": 123,
"nextCursor": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "NOT_FOUND",
"message": "<string>"
}Authorizations
Query Parameters
Restrict to a single place type. Combined with types when both are given.
Place type. island is a curated island that is not itself a subdivision (Santorini, Capri); area is a curated travel area (Cinque Terre, Cappadocia, Serengeti).
Available options:
region, country, subdivision, island, area, city, port, river, sea, ocean, canal, lake