curl --request GET \
--url https://api.cal.com/v2/timezones \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cal.com/v2/timezones"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cal.com/v2/timezones', 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://api.cal.com/v2/timezones",
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.cal.com/v2/timezones"
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.cal.com/v2/timezones")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/timezones")
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{
"status": "success",
"data": [
{
"city": "San Francisco",
"timezone": "America/Los_Angeles",
"country": "United States of America",
"region": "California",
"pop": 2091036
}
]
}Get timezones
Returns the cities Cal.com knows a timezone for, as a city to show the user and the IANA timezone to store and to send back to Cal.com. Without search every city is returned, around 7000 of them.
search searches the full source dataset by city name and additionally matches timezone names, so a search for an abbreviation such as PDT resolves to { "city": "Pacific Time - US & Canada", "timezone": "America/Los_Angeles" }. City and alias names match by case-insensitive substring; complete IANA identifiers also match by case-insensitive equality. Partial IANA identifiers are not matched; timezone matches come first, then cities ordered by population, so the most likely answer is first. City results include country and region to distinguish same-named cities. Each city name and timezone pair appears once; display the location fields alongside the city and let the user choose. Timezone entries have no pop, country or region.
Cal.com stores the IANA identifier, never an abbreviation or an offset: America/Los_Angeles already means PDT in summer and PST in winter, and the response has no offset to interpret.
curl --request GET \
--url https://api.cal.com/v2/timezones \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cal.com/v2/timezones"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cal.com/v2/timezones', 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://api.cal.com/v2/timezones",
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.cal.com/v2/timezones"
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.cal.com/v2/timezones")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/timezones")
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{
"status": "success",
"data": [
{
"city": "San Francisco",
"timezone": "America/Los_Angeles",
"country": "United States of America",
"region": "California",
"pop": 2091036
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Match city or timezone names by case-insensitive substring, or a complete IANA timezone identifier by case-insensitive equality. Omit it to get every city.
100"PDT"
Was this page helpful?