Level 1M12Lesson 12.4

beginner35 minby DevFox

fetch: getting data from a web API

Ask a real weather service for tomorrow’s forecast. Learn what a web API, a URL, a query and a status code are, send a request with fetch and read its JSON body with a second await, give that body a type, and check response.ok so a bad answer is caught by your own code, while no answer at all ends in fetch failed.

  • Fundamentals
  • TypeScript
`fetch`: getting data from a web API. Read this lesson at .