← See all modules
Module 6Full course

Data from the internet

APIs, fetch and JSON, ready-made libraries, and Node: an app that tells you if it will rain in your city.

4 lessons · 95 min

What you'll build

Real apps fetch data from the internet and use code other people wrote. In this module you build "Will it rain?": type a city and see the weather forecast in a chart, with data from a free API. Along the way, you understand APIs, fetch, and JSON, learn to use a library, and run JavaScript outside the browser with Node.

  • Real data, no keyA free weather forecast API that you call straight from the page.
  • Ready-made codeHow to find a library, read its docs, and use it, the way the big projects do.
  • Ready for the projectsEverything the map app and the AI app use, learned in a small project.

What you'll learn

  • What an API is: address, parameters, and a JSON response
  • Fetching data with fetch, async, and await, and handling errors
  • Using a library from a CDN and reading its docs
  • Node and npm: package.json, installing packages, and running scripts

The lessons

0 of 4 lessons complete
  1. 1What an API isHow apps ask other computers for data. Requests and responses, the parts of an API address, reading a JSON answer, and the docs that tell you what you can ask.🔒
  2. 2fetch, async, and awaitAsk an API for data from your code, wait for the answer without freezing the page, handle loading and errors, and build the first step of Will it rain?🔒
  3. 3Using a libraryCode other people wrote and shared. When to use a library, how to load one from a CDN with a pinned version, how to read its docs, and a forecast chart with Chart.js.🔒
  4. 4Node and npm, JavaScript outside the browserRun JavaScript in the terminal with Node, install libraries with npm, understand package.json and node_modules, and finish Will it rain?🔒