リクエストヘッダー
| Name | Required | Description |
|---|---|---|
X-RapidAPI-Key | required | Your RapidAPI key. Get one free. |
X-RapidAPI-Host | required | nearest-city.p.rapidapi.com |
エンドポイント
GET
/v1/geo/nearest-city Find the nearest city to a coordinate
パラメータ
| Name | Type | Required | Default | Constraints |
|---|---|---|---|---|
lat | number | required | — | -90-90 |
lon | number | required | — | -180-180 |
コード例
curl --request GET \
--url 'https://nearest-city.p.rapidapi.com/v1/geo/nearest-city?lat=0&lon=0' \
--header 'x-rapidapi-key: YOUR_API_KEY' \
--header 'x-rapidapi-host: nearest-city.p.rapidapi.com' const url = "https://nearest-city.p.rapidapi.com/v1/geo/nearest-city?lat=0&lon=0";
const options = {
method: "GET",
headers: {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "nearest-city.p.rapidapi.com"
}
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data); import requests
url = "https://nearest-city.p.rapidapi.com/v1/geo/nearest-city"
querystring = {"lat": 0, "lon": 0}
headers = {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "nearest-city.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json()) インタラクティブな例
$ GET /v1/geo/nearest-city?lat=35.69&lon=139.69
{"name":"Tokyo","country":"JP","latitude":35.6895,"longitude":139.69171,"population":8336599,"timezone":"Asia/Tokyo","distance_km":0.16} 購読してライセンスを取得する
RapidAPI の商用利用可能な層を使用して、この API にアクセスします。サイドプロジェクト、スタートアップ、大量生産アーキテクチャ向けに設計された柔軟なプラン。
開発者サポート
統合にヘルプが必要ですか? またはカスタム エンドポイント リクエストがありますか?当社のエンジニアリング チームは、認証、ペイロード スキーマ、および高頻度のレート制限の引き上げを支援します。
システムパフォーマンス
99.9% の稼働時間 SLA で 24 時間年中無休で監視されます。グローバルに分散されたエッジ キャッシュを備えたクラウドネイティブのマイクロサービス上に構築され、超低遅延の応答時間を保証します。
すべてのシステムが稼働中