← Node.js & APIs

Lesson 3 of 3 · 9 min

Calling APIs

fetch requests data: const res = await fetch(url); const data = await res.json().

Always handle errors — networks fail, and users deserve a friendly message.

Practice

Write pseudocode that fetches a list of jokes and shows an error message on failure.

Quiz

+50 pts
1. fetch returns data after…
2. Errors should be…

Optional resources

Your lesson toolkit

No purchase or partner signup is required to complete this course or earn quiz points.

These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.

Node.js

Install the runtime and follow the official guides.

Free and open source.

Explore tool