LoginSignup
4
3

More than 5 years have passed since last update.

Node-REDでWEB API(お天気Webサービス)を試す

Posted at

お天気Webサービスから情報を取得する

Livedoor のお天気Webサービス(Livedoor Weather Web Service / LWWS)を利用してみます。
全国の地点定義表で取得したい地域のidを確認してください。
livedoor お天気Webサービス仕様
http://weather.livedoor.com/weather_hacks/webservice
全国の地点定義表(RSS)
http://weather.livedoor.com/forecast/rss/primary_area.xml
(例)「福岡県・久留米の天気」を取得する場合
http://weather.livedoor.com/forecast/webservice/json/v1?city=400040

ノードの配置

キャプチャ.PNG
地域(400040は福岡県・久留米)を指定して天気予報を教えてもらいます

injectノード

キャプチャ.PNG
ペイロードに地域IDをセット

http requestノード

http://weather.livedoor.com/forecast/webservice/json/v1?city={{payload}}

ペイロードの地域IDをパラメータにセットしてGETコマンド送信

キャプチャ.PNG

実行結果

キャプチャ.PNG

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3