Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Node-RED Programming

You're reading from   Practical Node-RED Programming Learn powerful visual programming techniques and best practices for the web and IoT

Arrow left icon
Product type Paperback
Published in Mar 2021
Publisher Packt
ISBN-13 9781800201590
Length 326 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Taiji Hagino Taiji Hagino
Author Profile Icon Taiji Hagino
Taiji Hagino
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Node-RED Basics
2. Chapter 1: Introducing Node-RED and Flow-Based Programming FREE CHAPTER 3. Chapter 2: Setting Up the Development Environment 4. Chapter 3: Understanding Node-RED Characteristics by Creating Basic Flows 5. Chapter 4: Learning the Major Nodes 6. Section 2: Mastering Node-RED
7. Chapter 5: Implementing Node-RED Locally 8. Chapter 6: Implementing Node-RED in the Cloud 9. Chapter 7: Calling a Web API from Node-RED 10. Chapter 8: Using the Project Feature with Git 11. Section 3: Practical Matters
12. Chapter 9: Creating a ToDo Application with Node-RED 13. Chapter 10: Handling Sensor Data on the Raspberry Pi 14. Chapter 11: Visualize Data by Creating a Server-Side Application in the IBM Cloud 15. Chapter 12: Developing a Chatbot Application Using Slack and IBM Watson 16. Chapter 13: Creating and Publishing Your Own Node on the Node-RED Library 17. Other Books You May Enjoy Appendix: Node-RED User Community

How to call the web API on a node

So far, we've learned what a RESTful API is and which node is appropriate for an API call.

In this part, let's create a flow that actually calls the API from Node-RED and learn how to call the API and how to handle the result value from the API.

There are a few things to think about first, such as which API to call. Fortunately, various APIs are published on the internet.

This time, I would like to use the OpenWeatherMap API. In OpenWeatherMap, for example, the following APIs for data acquisition are prepared:

  • Current weather data
  • Hourly forecast 4 days
  • Daily forecast 16 days
  • Climatic forecast 30 days
  • Weather alerts
  • And more...

For more information, please see the official website of OpenWeatherMap: https://openweathermap.org/.

Okay, let's prepare to use the OpenWeatherMap API.

Creating an account

To use the OpenWeatherMap API, we need to create an account. Please access the following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime