cURL
curl --location 'https://www.headout.com/api/public/v1/city/' \
--header 'Headout-Auth: <YOUR_API_KEY>'
import requests
url = "https://www.headout.com/api/public/v1/city/"
headers = {"Headout-Auth": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Headout-Auth': '<api-key>'}};
fetch('https://www.headout.com/api/public/v1/city/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.headout.com/api/public/v1/city/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Headout-Auth: <api-key>"
],
]);
$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://www.headout.com/api/public/v1/city/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Headout-Auth", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.headout.com/api/public/v1/city/")
.header("Headout-Auth", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.headout.com/api/public/v1/city/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Headout-Auth"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"code": "DUBAI",
"name": "Dubai",
"image": {
"url": "//cdn-imgix.headout.com/media/images/7ceacca12e93245d25c59e5743b6c5d9-dubai-city-01.jpg"
}
}
],
"nextUrl": "https://www.headout.com/api/public/v1/city?offset=1&limit=1",
"prevUrl": null,
"total": 874,
"nextOffset": 1
}Cities
List all active cities
We are soon moving to v2 APIs and v1 will be deprecated. Switch to v2 using the version selector above.
List all active cities where Headout experiences are available.
GET
/
api
/
public
/
v1
/
city
/
cURL
curl --location 'https://www.headout.com/api/public/v1/city/' \
--header 'Headout-Auth: <YOUR_API_KEY>'
import requests
url = "https://www.headout.com/api/public/v1/city/"
headers = {"Headout-Auth": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Headout-Auth': '<api-key>'}};
fetch('https://www.headout.com/api/public/v1/city/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.headout.com/api/public/v1/city/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Headout-Auth: <api-key>"
],
]);
$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://www.headout.com/api/public/v1/city/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Headout-Auth", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.headout.com/api/public/v1/city/")
.header("Headout-Auth", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.headout.com/api/public/v1/city/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Headout-Auth"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"code": "DUBAI",
"name": "Dubai",
"image": {
"url": "//cdn-imgix.headout.com/media/images/7ceacca12e93245d25c59e5743b6c5d9-dubai-city-01.jpg"
}
}
],
"nextUrl": "https://www.headout.com/api/public/v1/city?offset=1&limit=1",
"prevUrl": null,
"total": 874,
"nextOffset": 1
}Authorizations
Query Parameters
Number of items to skip before starting to collect the result set.
Maximum number of items to return.
Response
200 - application/json
Successful response
The cities in this page of results.
Show child attributes
Show child attributes
Full URL to fetch the next page of results. Null if on the last page.
Full URL to fetch the previous page of results. Null if on the first page.
Total number of cities across all pages.
Offset value to use in the next request to retrieve the following page.
Was this page helpful?