OpenWeatherMap の API を更新 -One Call API 3.0-

以前から何度かメールが来ていたのですが,天気情報の提供をしてくれている OpenWeatherMap が One Call 2.5 をクローズするので One Call 3.0 に移行するようにとのことです.
クローズは6月 → 2024-08-19 と伸びていたのですがもう伸びなそうだなと移行してみました.

自分は OpenWeatherMap の API は個人利用のみで PC のウィジット,たまに手動で wego 等で天気確認,Android スマートフォン(QuickWeather)という感じです.

One Call 3.0 is free 1,000 calls/day

1日1000回まで無料とのことなのでなにかバグでも踏んだりしない限り余裕でしょう.

一応移行ガイドもあります.

移行ガイドの Subscribe リンクから辿ると請求情報などを入力する必要があるようです.これまではメールアドレスくらいだったのでちょっと面倒.

openweather payment

請求先はstripe 経由での JCB も OK でした.

請求情報がうまく通ると「Billing plans」に移動します.

openweather billing

Price (excl. VAT) を見ると,

Free limit per day: 1,000 calls
After: 0.12 GBP per 100 calls

とのことで 1日1000回まで無料,その後は 100呼び出しごとに 0.12 GBP(執筆時点で 23.04円) 掛るようです.
2000回まで呼べるようになっているので最大 230円/日ほどになりそう.

呼び出し制限の「Calls per day (no more than)」が 2000 になっているので, 900 に変更してみました.多分無料枠の 1000 回より前の 900 回で止まると思います.

利用の際の API key ですが,以前の 2.5 のときのものがそのまま使えるようです.ただ,One Call 3.0 に移行してすぐは以下のようにエラーとなり,数分程すると使えるようになったようです.

$ curl 'https://api.openweathermap.org/data/3.0/onecall?lat=33.44&lon=-94.04&appid=API_KEY'
{"cod":401, "message": "Please note that using One Call 3.0 requires a separate subscription to the One Call by Call plan. Learn more here https://openweathermap.org/price.
If you have a valid subscription to the One Call by Call plan, but still receive this error, then please see https://openweathermap.org/faq#error401 for more info."}

API の利用状況は https://home.openweathermap.org/statistics/onecall_30 🏛️ で確認できました.以下のような感じで確認できます.リアルタイムではなく少し遅れるようです.

openweather usage01
openweather usage02

暫くは毎日ここを見ておこうと思います.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)