Skip to content

Get cities

GET
/v1/cities
Server

Get cities

Authorizations

api_key
TypeAPI Key (header: X-Api-Key)

Parameters

Query Parameters

sorting
Typestring
default
page_size

Number of items per page

Typeinteger
default50
page

Current page

Typeinteger
default1
country

Country code in iso-3

Typestring
ExampleNLD
event_startdate

Start date of the event

Typestring
Example2024-01-01
query
Typestring
ExampleAmsterdam

Responses

OK
application/json
JSON
{
"cities": [
{
"city": "Amsterdam",
"country": "NLD"
}
],
"pagination": {
"total_size": 1,
"page_size": 50,
"next_page": "string",
"previous_page": "string"
}
}

Samples

cURL
curl -X GET \
'https://api.xs2event.com/v1/cities?country=NLD&event_startdate=2024-01-01&query=Amsterdam' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.xs2event.com/v1/cities?country=NLD&event_startdate=2024-01-01&query=Amsterdam', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.xs2event.com/v1/cities';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];
$query = http_build_query([
    'country' => 'NLD',
    'event_startdate' => '2024-01-01',
    'query' => 'Amsterdam',
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://api.xs2event.com/v1/cities'
params = {
    'country': 'NLD',
    'event_startdate': '2024-01-01',
    'query': 'Amsterdam'
}
headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, params=params, headers=headers)
print(response.json())