リクエストヘッダー
| Name | Required | Description |
|---|---|---|
X-RapidAPI-Key | required | Your RapidAPI key. Get one free. |
X-RapidAPI-Host | required | timezone-by-city.p.rapidapi.com |
エンドポイント
GET
/v1/time/zone Look up the IANA time zone and current local time of a city
パラメータ
| Name | Type | Required | Default | Constraints |
|---|---|---|---|---|
city | string | required | — | matches \S |
country | string | optional | — | — |
コード例
curl --request GET \
--url 'https://timezone-by-city.p.rapidapi.com/v1/time/zone?city=example' \
--header 'x-rapidapi-key: YOUR_API_KEY' \
--header 'x-rapidapi-host: timezone-by-city.p.rapidapi.com' const url = "https://timezone-by-city.p.rapidapi.com/v1/time/zone?city=example";
const options = {
method: "GET",
headers: {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "timezone-by-city.p.rapidapi.com"
}
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data); import requests
url = "https://timezone-by-city.p.rapidapi.com/v1/time/zone"
querystring = {"city": "example"}
headers = {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "timezone-by-city.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json()) GET
/v1/time/zone/countries List all countries with timezone data in the dataset, sorted alphabetically by ISO code.
コード例
curl --request GET \
--url 'https://timezone-by-city.p.rapidapi.com/v1/time/zone/countries' \
--header 'x-rapidapi-key: YOUR_API_KEY' \
--header 'x-rapidapi-host: timezone-by-city.p.rapidapi.com' const url = "https://timezone-by-city.p.rapidapi.com/v1/time/zone/countries";
const options = {
method: "GET",
headers: {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "timezone-by-city.p.rapidapi.com"
}
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data); import requests
url = "https://timezone-by-city.p.rapidapi.com/v1/time/zone/countries"
headers = {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "timezone-by-city.p.rapidapi.com"
}
response = requests.get(url, headers=headers)
print(response.json()) インタラクティブな例
$ GET /v1/time/zone?city=London
{"city":"London","country":"GB","timezone":"Europe/London","current_time":"2026-07-02T13:00:00+01:00","utc_offset":"+01:00"} 購読してライセンスを取得する
RapidAPI の商用利用可能な層を使用して、この API にアクセスします。サイドプロジェクト、スタートアップ、大量生産アーキテクチャ向けに設計された柔軟なプラン。
開発者サポート
統合にヘルプが必要ですか? またはカスタム エンドポイント リクエストがありますか?当社のエンジニアリング チームは、認証、ペイロード スキーマ、および高頻度のレート制限の引き上げを支援します。
システムパフォーマンス
99.9% の稼働時間 SLA で 24 時間年中無休で監視されます。グローバルに分散されたエッジ キャッシュを備えたクラウドネイティブのマイクロサービス上に構築され、超低遅延の応答時間を保証します。
すべてのシステムが稼働中