10.CoreInkでOpenWeatherMap(1)


10.CoreInkでOpenWeatherMap(1)

目標は、wifiを接続し、OpenWeatherMap (https://openweathermap.org/)からjson形式で天気情報を取得し表示します。日本語表示部分もあります。
今回は、OpenWeatherMapのAPIキーの取得、価格(無料有り)、APIの種類、ワンコールAPIまで。次回は、ワンコールAPIで現在の天気を表示するスケッチです。

APIキーの取得

  1. https://openweathermap.org/price
    にて無料の欄の「APIキーを取得する」をクリックします。
  2. 名前、メールアドレス、自分で決めたパスワードを入力します。
  3. メールでAPIキーを送ってくれます。
  4. このキーをスケッチに記入します。

価格と制限

https://openweathermap.org/price
  • 無料 (有料もあります)
  • API呼出制限 : 60回/分 (1回 1秒ペース)
    and 1,000回/日 (1回 1.4分ペース)
    and 100万回/月 (1回 2.6秒ペース)
  • 現在の天気 (無料)
  • 1H後までの毎分予報 (ワンコールAPIにて 無料)
  • 2日後までの毎時予報 (有料は4日)
  • 5日後までの毎時大気汚染 (無料)
  • 5日後までの3時間ごと予報 (無料)
  • 7日後までの毎日の天気予報 (有料は16日)
  • 全国気象警報 (日本はない)
  • 5日前までの天気 (有料は1年)
  • トリガー(特定の温湿度、気圧などが特定期間に発生時に機能 無料)

WeatherAPIの種類

https://openweathermap.org/api
有料も含め以下のAPIがあります。

現在の気象データ
  • 毎時予報4日
  • ワンコールAPI
  • 毎日の天気予報16日
  • 気候予報30日
  • 一括ダウンロード
  • Road Risk
  • 気象警報プッシュ通知
  • 5日/3時間の天気予報
過去の気象データ
  • 過去の気象
  • 統計気象
  • 蓄積パラメータ
  • 履歴バルク
  • 米国郵便番号の州別気象
  • 履歴予測バルク
マップコレクション
  • 天気図2.0
  • 天気図1.0
  • 全球降水観測計画
  • レリーフマップ
その他
  • 大気汚染
  • ジオコーディング
  • 気象観測所
  • 天気のトリガー
  • UV指数(2021/4/1まで)

ワンコールAPI

https://openweathermap.org/api/one-call-api
ここでは、無料のワンコールAPIについて見ていきます。API呼び出しを1回だけ行い、特定の場所の以下のデータを取得できます。しかし、5日後までの3時間ごとの予報はありません。

1. 現在の天気 current

  • 現在・日の出・日没時刻(時刻はUnix,UTC)
  • 天気アイコンID,概略気象,詳細気象ID,詳細気象
  • 温度,体感温度,結露気温,湿度,海面気圧
  • 風速,風向
  • UV指数,平均視程,曇量(%)
  • 利用可能な場合、突風,1H前からの雨量・積雪量

2. 1H後までの毎分予報 minutely

* 現在から1H後までの1分ごとの降水量が61データあります。
  • 時刻(時刻はUnix,UTC)と降水量(mm)

3. 2日後までの毎時予報 hourly

* 現在から1Hごとに48データあります。1.の現在の天気から無いのは、日の出・日没時刻のみです。
  • 予測時刻(Unix,UTC)
  • 天気アイコンID,概略気象,詳細気象ID,詳細気象
  • 降水確率
  • 温度,体感温度,結露気温,湿度,海面気圧
  • 風速,風向
  • UV指数,可視性,曇量(%)
  • 利用可能な場合、突風,1H前からの雨量・積雪量

4. 7日後までの毎日の天気予報 daily

* 7日後までの毎日の8日間データがあります。1の現在天気から無いのは、平均視程。増えているのは、気温(朝・日中・夕方・夜),毎日の最高・最低気温,人感温度(朝・日中・夕方・夜)です。
  • 予測時刻,日の出・日没時間(Unix,UTC)
  • 天気アイコンID,概略気象,詳細気象ID,詳細気象
  • 降水確率
  • 気温(朝・日中・夕方・夜)
  • 毎日の最高・最低気温
  • 体感温度(朝・日中・夕方・夜)
  • 結露気温,湿度,海面気圧
  • 風速,風向
  • その日のUV指数の最大値,曇量(%)
  • 利用可能な場合、突風,降水量,積雪量

5. 気象警報 alerts

  • 場所
  • 開始・終了日時(Unix,UTC)
  • 警報名・説明

6. 5日前までの気象データ

API呼び出し

https://api.openweathermap.org/data/2.5/onecall?lat=35.447781&lon=139.642502&units=metric&lang=ja&appid={API key}
  • lat=35.447781 : 緯度(都市コードIDではできない様子)
  • lon=139.642502 : 経度(横浜の例)
  • units=metric : ℃(摂氏), m/s(風速)
  • lang=ja : 日本語 description(天気)の内容を翻訳
  • {API key} : 自分のAPIキー

概略気象,詳細気象,詳細気象ID,天気アイコンID

https://openweathermap.org/weather-conditions#Weather-Condition-Codes-2
天気アイコンは12種類あるが、太陽が昼のオレンジと、夜の黒があるので、それを除くと9種類になる。
  • 晴天(太陽)
    01d.png , 01n.png
  • いくつかの雲(太陽と雲)
    02d.png , 02n.png
  • 雨(02d.pngに雨)
    10d.png , 10n.png
  • 散在する雲(白い雲)
    03d.png = 03n.png
  • 壊れた雲(03d.pngに黒い雲)
    04d.png = 04n.png
  • にわか雨(04d.pngに雨)
    09d.png = 09n.png
  • 雷雨(04d.pngに雷)
    11d.png = 11n.png
  • 雪(雪の結晶)
    13d.png = 13n.png
  • 靄(もや 横線)
    50d.png = 50n.png
詳細な天気の内容は、
  • 雷雨(ID200-232)
    小雨による雷雨, 雨と雷雨, 大雨による雷雨, 軽い雷雨, 雷雨, 激しい雷雨, 不規則な雷雨, 軽い霧雨と雷雨, 霧雨と雷雨, 激しい霧雨を伴う雷雨
  • 霧雨(ID300-321)
    光度の霧雨, 霧雨, 激しい霧雨, にわか雨と霧雨, にわか雨
  • 雨(ID500-531)
    小雨, 適度な雨, 大雨, 非常に大雨, 極端な雨, 着氷性の雨, にわか雨, 激しいにわか雨
  • 雪(ID600-622)
    小雪, 雪, 大雪, みぞれ, 軽いシャワーみぞれ, シャワーみぞれ, 小雨と雪, 雨と雪, にわか雪, シャワー雪
  • 雰囲気(ID701-781)
    靄, 煙, ヘイズ, 砂/塵旋風, 霧, 砂, ほこり, 火山灰, スコール, 竜巻
  • 晴天・雲(ID800-804)
    晴天, いくつかの雲:11-25%, 散在する雲:25-50%, 壊れた雲:51-84%, どんよりした雲:85-100%

観測点

http://bulk.openweathermap.org/sample/
から都市リスト city.list.json.gz をダウンロードし、解凍すると日本の "country": "JP", の数が1400ほどあります。さらに都市名(ここでは、Yokohama)で検索すると、

{
  "id": 1848354,
  "name": "Yokohama",  // 横浜
  "state": "",
  "country": "JP",
  "coord": {
      "lon": 139.642502,
      "lat": 35.447781}  // 神奈川県
},
{
  "id": 2127436,
  "name": "Yokohama",  // 横浜
  "state": "",
  "country": "JP",
  "coord": {
      "lon": 141.25,
      "lat": 41.083328}  // 青森県
},
と2ケ所あり、都市名だけでは確定できないので、緯度経度も見て都市IDか、緯度経度で指定します。
  • 東経 : 139.0°(西)~139.9°(東)
  • 北緯 : 35.0°(南)~35.9°(北)
の関東の一部の範囲内では、以下があります。

{"id":1847963,"name":"Atsugi","state":"","country":"JP","coord":{"lon":139.359726,"lat":35.438889}},
{"id":1847968,"name":"Zushi","state":"","country":"JP","coord":{"lon":139.585556,"lat":35.291672}},
{"id":1848004,"name":"Zama","state":"","country":"JP","coord":{"lon":139.388611,"lat":35.488892}},
{"id":1848040,"name":"Yūrakuchō","state":"","country":"JP","coord":{"lon":139.766663,"lat":35.666672}},
{"id":1848113,"name":"Yugawara","state":"","country":"JP","coord":{"lon":139.066666,"lat":35.150002}},
{"id":1848188,"name":"Yoshikawa","state":"","country":"JP","coord":{"lon":139.839447,"lat":35.885281}},
{"id":1848254,"name":"Yono","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.883331}},
{"id":1848305,"name":"Yokota","state":"","country":"JP","coord":{"lon":139.383331,"lat":35.75}},
{"id":1848313,"name":"Yokosuka","state":"","country":"JP","coord":{"lon":139.667221,"lat":35.283611}},
{"id":1848354,"name":"Yokohama","state":"","country":"JP","coord":{"lon":139.642502,"lat":35.447781}},
{"id":1848440,"name":"Yatsuzawa","state":"","country":"JP","coord":{"lon":139.116669,"lat":35.616669}},
{"id":1848499,"name":"Yashio","state":"","country":"JP","coord":{"lon":139.83905,"lat":35.822552}},
{"id":1848598,"name":"Yamatominami","state":"","country":"JP","coord":{"lon":139.456116,"lat":35.46722}},
{"id":1848667,"name":"Yamakita","state":"","country":"JP","coord":{"lon":139.073334,"lat":35.35667}},
{"id":1848848,"name":"Yabuhana","state":"","country":"JP","coord":{"lon":139.467224,"lat":35.408329}},
{"id":1848903,"name":"Warabi","state":"","country":"JP","coord":{"lon":139.704437,"lat":35.826389}},
{"id":1849186,"name":"Urayasu","state":"","country":"JP","coord":{"lon":139.888611,"lat":35.670559}},
{"id":1849407,"name":"Uenohara","state":"","country":"JP","coord":{"lon":139.116669,"lat":35.616669}},
{"id":1849423,"name":"Ueki","state":"","country":"JP","coord":{"lon":139.516663,"lat":35.349998}},
{"id":1849897,"name":"Totsukachō","state":"","country":"JP","coord":{"lon":139.533325,"lat":35.400002}},
{"id":1850144,"name":"TokyoPrefecture","state":"","country":"JP","coord":{"lon":139.691711,"lat":35.689499}},
{"id":1850147,"name":"Tokyo","state":"","country":"JP","coord":{"lon":139.691711,"lat":35.689499}},
{"id":1850181,"name":"Tokorozawa","state":"","country":"JP","coord":{"lon":139.469025,"lat":35.79916}},
{"id":1850692,"name":"Nishi-Tokyo-shi","state":"","country":"JP","coord":{"lon":139.5383,"lat":35.725262}},
{"id":1850693,"name":"Tanashichō","state":"","country":"JP","coord":{"lon":139.522217,"lat":35.723888}},
{"id":1851307,"name":"Tachikawa","state":"","country":"JP","coord":{"lon":139.41806,"lat":35.69278}},
{"id":1851604,"name":"Sōka","state":"","country":"JP","coord":{"lon":139.804443,"lat":35.820278}},
{"id":1851898,"name":"Shirako","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.76667}},
{"id":1851992,"name":"Shiomidai","state":"","country":"JP","coord":{"lon":139.533325,"lat":35.583328}},
{"id":1852140,"name":"Shinagawa-ku","state":"","country":"JP","coord":{"lon":139.730164,"lat":35.60902}},
{"id":1852278,"name":"Shimokodanaka","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.566669}},
{"id":1852427,"name":"Shinbashichō","state":"","country":"JP","coord":{"lon":139.516663,"lat":35.433331}},
{"id":1852502,"name":"Shiki","state":"","country":"JP","coord":{"lon":139.583328,"lat":35.833328}},
{"id":1852676,"name":"Umegaoka","state":"","country":"JP","coord":{"lon":139.649994,"lat":35.633331}},
{"id":1853058,"name":"Sakurakabu","state":"","country":"JP","coord":{"lon":139.466675,"lat":35.450001}},
{"id":1853202,"name":"Sakaguchi","state":"","country":"JP","coord":{"lon":139.033325,"lat":35.950001}},
{"id":1853209,"name":"Sakado","state":"","country":"JP","coord":{"lon":139.388885,"lat":35.95694}},
{"id":1853226,"name":"Saitama-ken","state":"","country":"JP","coord":{"lon":139.649033,"lat":35.857208}},
{"id":1853295,"name":"Sagamihara","state":"","country":"JP","coord":{"lon":139.354446,"lat":35.553059}},
{"id":1854162,"name":"Ōme","state":"","country":"JP","coord":{"lon":139.243057,"lat":35.78389}},
{"id":1854492,"name":"Ōiso","state":"","country":"JP","coord":{"lon":139.30278,"lat":35.303059}},
{"id":1854530,"name":"Ōi","state":"","country":"JP","coord":{"lon":139.516663,"lat":35.851109}},
{"id":1854626,"name":"Ogose","state":"","country":"JP","coord":{"lon":139.289993,"lat":35.958889}},
{"id":1854642,"name":"Ōgimachiya","state":"","country":"JP","coord":{"lon":139.399994,"lat":35.833328}},
{"id":1854747,"name":"Odawara","state":"","country":"JP","coord":{"lon":139.159714,"lat":35.255562}},
{"id":1855078,"name":"Noda","state":"","country":"JP","coord":{"lon":139.858063,"lat":35.941109}},
{"id":1855380,"name":"Ninomiya","state":"","country":"JP","coord":{"lon":139.253326,"lat":35.303329}},
{"id":1855444,"name":"Nihon’ōdōri","state":"","country":"JP","coord":{"lon":139.649994,"lat":35.450001}},
{"id":1855503,"name":"Nerima","state":"","country":"JP","coord":{"lon":139.649994,"lat":35.73333}},
{"id":1855730,"name":"Nakayama","state":"","country":"JP","coord":{"lon":139.949997,"lat":35.716671}},
{"id":1856184,"name":"Nagareyama","state":"","country":"JP","coord":{"lon":139.902664,"lat":35.8563}},
{"id":1856367,"name":"Musashino","state":"","country":"JP","coord":{"lon":139.559433,"lat":35.706108}},
{"id":1856560,"name":"Morohongō","state":"","country":"JP","coord":{"lon":139.304443,"lat":35.935558}},
{"id":1856942,"name":"Mitaka-shi","state":"","country":"JP","coord":{"lon":139.559631,"lat":35.68351}},
{"id":1856950,"name":"Mita","state":"","country":"JP","coord":{"lon":139.733337,"lat":35.650002}},
{"id":1857105,"name":"Minato","state":"","country":"JP","coord":{"lon":139.887497,"lat":35.21806}},
{"id":1857140,"name":"Minamisenju","state":"","country":"JP","coord":{"lon":139.816666,"lat":35.73333}},
{"id":1857144,"name":"Minamirinkan","state":"","country":"JP","coord":{"lon":139.449997,"lat":35.48333}},
{"id":1857553,"name":"Matsudo","state":"","country":"JP","coord":{"lon":139.899994,"lat":35.783329}},
{"id":1857654,"name":"Marunouchi","state":"","country":"JP","coord":{"lon":139.766663,"lat":35.683331}},
{"id":1857692,"name":"Manazuru","state":"","country":"JP","coord":{"lon":139.135559,"lat":35.153889}},
{"id":1857871,"name":"Machida","state":"","country":"JP","coord":{"lon":139.450836,"lat":35.540279}},
{"id":1858480,"name":"Kugayama","state":"","country":"JP","coord":{"lon":139.600006,"lat":35.683331}},
{"id":1858729,"name":"Koshigaya","state":"","country":"JP","coord":{"lon":139.783325,"lat":35.883331}},
{"id":1858964,"name":"Kokubunji","state":"","country":"JP","coord":{"lon":139.475555,"lat":35.702221}},
{"id":1859088,"name":"Koganei","state":"","country":"JP","coord":{"lon":139.501114,"lat":35.691391}},
{"id":1859116,"name":"Kodaira","state":"","country":"JP","coord":{"lon":139.483887,"lat":35.726391}},
{"id":1859393,"name":"Kisarazu","state":"","country":"JP","coord":{"lon":139.922501,"lat":35.374722}},
{"id":1859479,"name":"Kikuna","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.5}},
{"id":1859642,"name":"Kawasaki","state":"","country":"JP","coord":{"lon":139.717224,"lat":35.520561}},
{"id":1859730,"name":"Kawaguchi","state":"","country":"JP","coord":{"lon":139.720566,"lat":35.805}},
{"id":1859740,"name":"Kawagoe","state":"","country":"JP","coord":{"lon":139.485275,"lat":35.908611}},
{"id":1859842,"name":"Katase","state":"","country":"JP","coord":{"lon":139.474442,"lat":35.31694}},
{"id":1859884,"name":"Kasukabe","state":"","country":"JP","coord":{"lon":139.753616,"lat":35.976391}},
{"id":1859924,"name":"Kashiwa","state":"","country":"JP","coord":{"lon":139.968887,"lat":35.854439}},
{"id":1860244,"name":"Kanazawachō","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.349998}},
{"id":1860291,"name":"Kanagawa","state":"","country":"JP","coord":{"lon":139.338852,"lat":35.417461}},
{"id":1860310,"name":"Kamonomiya","state":"","country":"JP","coord":{"lon":139.183334,"lat":35.283329}},
{"id":1860437,"name":"Kamirenjaku","state":"","country":"JP","coord":{"lon":139.550003,"lat":35.683331}},
{"id":1860649,"name":"Kameari","state":"","country":"JP","coord":{"lon":139.850006,"lat":35.75}},
{"id":1860672,"name":"Kamakura","state":"","country":"JP","coord":{"lon":139.550278,"lat":35.308891}},
{"id":1861060,"name":"Japan","state":"","country":"JP","coord":{"lon":139.753098,"lat":35.68536}},
{"id":1861164,"name":"Iwatsuki","state":"","country":"JP","coord":{"lon":139.69194,"lat":35.94278}},
{"id":1861261,"name":"Itsukaichi","state":"","country":"JP","coord":{"lon":139.217773,"lat":35.725281}},
{"id":1861449,"name":"Isehara","state":"","country":"JP","coord":{"lon":139.307785,"lat":35.39056}},
{"id":1861642,"name":"Ina","state":"","country":"JP","coord":{"lon":139.25,"lat":35.716671}},
{"id":1861968,"name":"Ichikawa","state":"","country":"JP","coord":{"lon":139.924713,"lat":35.719719}},
{"id":1862143,"name":"Horinouchi","state":"","country":"JP","coord":{"lon":139.649994,"lat":35.683331}},
{"id":1862462,"name":"Hiratsuka","state":"","country":"JP","coord":{"lon":139.342224,"lat":35.323059}},
{"id":1862539,"name":"Hirakata","state":"","country":"JP","coord":{"lon":139.550003,"lat":35.933331}},
{"id":1862599,"name":"Hino","state":"","country":"JP","coord":{"lon":139.400284,"lat":35.673061}},
{"id":1862739,"name":"Higashishinagawa","state":"","country":"JP","coord":{"lon":139.733337,"lat":35.599998}},
{"id":1862978,"name":"Hayashi","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.216671}},
{"id":1862992,"name":"Hayama","state":"","country":"JP","coord":{"lon":139.583328,"lat":35.26667}},
{"id":1863023,"name":"Hatogaya-honchō","state":"","country":"JP","coord":{"lon":139.736389,"lat":35.834171}},
{"id":1863140,"name":"Harigaya","state":"","country":"JP","coord":{"lon":139.633331,"lat":35.866669}},
{"id":1863183,"name":"Hannō","state":"","country":"JP","coord":{"lon":139.318054,"lat":35.85194}},
{"id":1863356,"name":"Hakonegasaki","state":"","country":"JP","coord":{"lon":139.351105,"lat":35.76944}},
{"id":1863357,"name":"Hakone","state":"","country":"JP","coord":{"lon":139.033325,"lat":35.183331}},
{"id":1863431,"name":"Hadano","state":"","country":"JP","coord":{"lon":139.223618,"lat":35.371109}},
{"id":1863440,"name":"Hachiōji","state":"","country":"JP","coord":{"lon":139.323883,"lat":35.65583}},
{"id":1863713,"name":"Futtsu","state":"","country":"JP","coord":{"lon":139.818604,"lat":35.305279}},
{"id":1863905,"name":"Honchō","state":"","country":"JP","coord":{"lon":139.983337,"lat":35.693062}},
{"id":1864092,"name":"Fujisawa","state":"","country":"JP","coord":{"lon":139.470001,"lat":35.341942}},
{"id":1864154,"name":"Fuchu","state":"","country":"JP","coord":{"lon":139.483337,"lat":35.666672}},
{"id":1864231,"name":"Egota","state":"","country":"JP","coord":{"lon":139.666672,"lat":35.73333}},
{"id":1864338,"name":"Dōshi","state":"","country":"JP","coord":{"lon":139.216675,"lat":35.583328}},
{"id":1864381,"name":"Den’enchōfu","state":"","country":"JP","coord":{"lon":139.666672,"lat":35.583328}},
{"id":1864518,"name":"Chōfu","state":"","country":"JP","coord":{"lon":139.552216,"lat":35.65556}},
{"id":1864529,"name":"Chiyoda-ku","state":"","country":"JP","coord":{"lon":139.753632,"lat":35.694019}},
{"id":1864624,"name":"Chigasaki","state":"","country":"JP","coord":{"lon":139.403885,"lat":35.326111}},
{"id":1864637,"name":"Chichibu","state":"","country":"JP","coord":{"lon":139.076385,"lat":35.99028}},
{"id":1864815,"name":"Ichibanchō","state":"","country":"JP","coord":{"lon":139.75,"lat":35.683331}},
{"id":1864945,"name":"Atami","state":"","country":"JP","coord":{"lon":139.068604,"lat":35.089439}},
{"id":1865090,"name":"Asagaya-minami","state":"","country":"JP","coord":{"lon":139.649994,"lat":35.700001}},
{"id":1865485,"name":"Akashichō","state":"","country":"JP","coord":{"lon":139.783325,"lat":35.666672}},
{"id":1865714,"name":"Ageoshimo","state":"","country":"JP","coord":{"lon":139.588608,"lat":35.969719}},
{"id":1907116,"name":"Nakai","state":"","country":"JP","coord":{"lon":139.158615,"lat":35.96833}},
{"id":1907123,"name":"Hasuda","state":"","country":"JP","coord":{"lon":139.650833,"lat":35.975559}},
{"id":1907125,"name":"Kamifukuoka","state":"","country":"JP","coord":{"lon":139.50972,"lat":35.872501}},
{"id":1907146,"name":"Sayama","state":"","country":"JP","coord":{"lon":139.412125,"lat":35.852951}},
{"id":1907148,"name":"Fussa","state":"","country":"JP","coord":{"lon":139.323608,"lat":35.736671}},
{"id":1907157,"name":"Fujino","state":"","country":"JP","coord":{"lon":139.143066,"lat":35.606392}},
{"id":1907165,"name":"Kunitachi","state":"","country":"JP","coord":{"lon":139.434998,"lat":35.674438}},
{"id":1907174,"name":"Okura","state":"","country":"JP","coord":{"lon":139.470276,"lat":35.584721}},
{"id":1907190,"name":"Minawa","state":"","country":"JP","coord":{"lon":139.319443,"lat":35.522781}},
{"id":1907225,"name":"Kawara","state":"","country":"JP","coord":{"lon":139.272781,"lat":35.47361}},
{"id":1907235,"name":"Miyanomae","state":"","country":"JP","coord":{"lon":139.392776,"lat":35.422779}},
{"id":1907243,"name":"Takata","state":"","country":"JP","coord":{"lon":139.423065,"lat":35.33889}},
{"id":1907255,"name":"Koyasu","state":"","country":"JP","coord":{"lon":139.255554,"lat":35.41806}},
{"id":1907299,"name":"Asaka","state":"","country":"JP","coord":{"lon":139.601944,"lat":35.804722}},
{"id":1907300,"name":"Wako","state":"","country":"JP","coord":{"lon":139.623337,"lat":35.78944}},
{"id":1907301,"name":"Shimotoda","state":"","country":"JP","coord":{"lon":139.692505,"lat":35.809441}},
{"id":1907306,"name":"Komae","state":"","country":"JP","coord":{"lon":139.574432,"lat":35.636391}},
{"id":1907307,"name":"Kimitsu","state":"","country":"JP","coord":{"lon":139.891113,"lat":35.325279}},
{"id":1907309,"name":"Miura","state":"","country":"JP","coord":{"lon":139.619171,"lat":35.139999}},
{"id":6419432,"name":"Shōwajima","state":"","country":"JP","coord":{"lon":139.75,"lat":35.571671}},
{"id":6822131,"name":"Akikawa","state":"","country":"JP","coord":{"lon":139.294144,"lat":35.728779}},
{"id":6940394,"name":"Saitama","state":"","country":"JP","coord":{"lon":139.65657,"lat":35.90807}},
{"id":7279570,"name":"Higashimurayama","state":"","country":"JP","coord":{"lon":139.468521,"lat":35.754589}},

参考 UV指数

  • 1~2 弱い
    安心して戸外で過ごせる。
  • 3~5 中程度
    日中は日陰を利用しよう。長袖シャツ、日焼け止め、帽子を利用しよう。
  • 6~7 強い
  • 8~10 非常に強い
    日中の外出は控えよう。必ず、長袖シャツ、日焼け止め、帽子を利用しよう。
  • 11以上 極端に強い
https://www.data.jma.go.jp/gmd/env/uvhp/3-50uvindex_manual.html

参考 json

Arduinojsonの解説
https://arduinojson.org/v6/doc/deserialization/