Lab

APIs and GitHub

Click, change and break things here. Every request runs in your browser against a practice service, so nothing you do can cause a real problem.

Teacher view

Build a request

An API call is just a URL

Pick a city and options, then send the request. Watch the URL change.

https://api.open-meteo.com
/v1/forecast
press Send
Read the reply

Click a value to get its path

This is the reply from a weather request. Find the wind speed and click it to see its path.

Path: —
Value: —
Read the code

The fetch recipe: ask, convert, show

1 Ask the API 2 Turn the reply into data 3 Pick the value 4 Show it on the page

Your turn

Change the weather page

Edit the code. The preview updates as you type. Try changing the city coordinates or showing the wind speed too.

Tab indents. Escape leaves the editor.
Keys and limits

An API key is a wristband

Choose a key, then send requests. The practice service allows 30 requests before it rate-limits you.

no request yet 0 / 30
Docs

Docs beat guessing

Find: where does it say which URL to call?

1 / 4 found

To get weather data, send a GET request to . You must include in the query. If the service rejects a value it replies with . The reply body holds the current data, and the field of a repository shows how many people starred it.

Hint: the answer is in the text, not in your memory.
GitHub

Inside a repo: click around

Click each part of this repository page to see what it is for.

lesson-weather-app
Select a part of the repository.