Loading video player…

Calling Web APIs With fetch (Overview)

Welcome to Calling Web APIs With fetch! Fetch a URL, get JSON, use it: that recipe works until a request fails, and then it can’t tell you why. This course shows what travels over the wire, and what to do when it goes wrong.

Long Weekends Abroad

Throughout the course, you’ll build a planner for four friends abroad. Amara lives in Lisbon, Jonas in Berlin, Keiko in Osaka, and Mateo in Mexico City. Two real APIs, Nager.Date and the World Bank, give your planner each country’s public holidays and its name and capital city. Then it lists the long weekends that two or more friends share.

Its code is in the final code of the course summary and in the code download. Here’s what the planner printed on November 27, 2026, against the live APIs (the finished version also adds a deadline and a retry, which don’t change this output):

Language: Text
$ node plan.mjs 2026
Long weekends in 2026 that two or more of you share:
2026-05-01 to 2026-05-03
  Amara: Portugal, Lisbon
  Jonas: Germany, Berlin
  Mateo: Mexico, Mexico City
2026-12-25 to 2026-12-27
  Amara: Portugal, Lisbon
  Jonas: Germany, Berlin
  Mateo: Mexico, Mexico City

Keiko isn’t listed because a weekend counts as shared only when it starts and ends on the same days, and Japan’s long weekends in 2026 start and end on other days.

What You’ll Learn

By the end of this course, you’ll know how to:

  • Read the HTTP requests and responses that travel over the wire
  • Make and inspect HTTP requests with fetch
  • Read an API’s docs, and combine data from real web APIs
  • Handle failed requests, slow responses and missing data
  • Build a long weekend planner for four friends abroad

Before You Start

This is the last course in the Async JavaScript and Web APIs learning path, and it stands on its own. You can start here if you know async functions with await, and how to run them together with Promise.all() and Promise.allSettled(), catch their errors and time them out with AbortController. You also need JSON and ES modules.

If you’d like a refresher, then these RealJS courses cover them:

For tools, you need a terminal, a current version of Node.js, and any editor. The examples use Node.js 26:

Language: Shell
$ node --version
v26.13.1

How the Course Works

The course mixes text lessons and videos. Each of the first three sections ends with a coding exercise in your browser. The project gives you a brief and its checks, without a walkthrough. Then an AI mentor reviews your planner, and you build a small program of your own. A quiz and a summary close the course. You can download the sample code (.zip) and the slides (.pdf).

The next lesson is Read a Raw HTTP Exchange. It asks what really travels when a program asks for the holidays in Amara’s Portugal.

Download

Course Slides (.pdf)

2.5 MB
Download

Sample Code (.zip)

42.0 KB

00:00 Welcome to Calling Web APIs With fetch. Fetch a URL, get JSON, use it: that recipe works until a request fails, and then it can’t tell you why. This course shows what travels over the wire, and what to do when it goes wrong.

00:18 Here’s the finished planner you’ll build for four friends abroad. Amara lives in Lisbon, Jonas in Berlin, Keiko in Osaka and Mateo in Mexico City. Two real APIs, Nager.Date and the World Bank, give your planner each country’s public holidays and its name and capital city.

00:37 Then it lists the long weekends that two or more friends share.

00:43 In this course, you’ll learn how to: Read the HTTP requests and responses that travel over the wire. Make and inspect HTTP requests with fetch. Read an API’s docs, and combine data from real web APIs.

00:58 Handle failed requests, slow responses and missing data. And build a long weekend planner for four friends abroad.

01:08 This is the last course in the Async JavaScript and Web APIs path, and it stands on its own. You can start here if you know async functions with await, and how to run them together with Promise.all and allSettled, catch their errors and time them out with AbortController.

01:25 You also need JSON and ES modules. You’ll need a terminal, a current Node and any editor.

01:34 The course mixes text lessons and videos. The first three sections each end with a coding exercise in your browser. The project gives you a brief and its checks, without a walkthrough.

01:45 Then an AI mentor reviews your planner, and you build a small program of your own. A quiz and a summary close the course. You can download the code and slides.

01:55 The next lesson is Read a Raw HTTP Exchange. It asks what really travels when a program asks for the holidays in Amara’s Portugal.

Become a Member to join the conversation.