BlocosIA Wiki Editor

Internet data (JSON)

Advanced · Ask an API for a city's temperature and show it on the stage.

Interactive tutorial: the editor checks each step by itself.

  1. Add the "Web and JSON" extension.
  2. Choose a sprite and drag "when flag clicked".
  3. Snap "GET request to … named request1 and wait" below (the weather address is already filled in).
  4. Snap "say" (Looks) and put inside it "value current.temperature_2m of (response data of request1)".
  5. Check: the second slot of "value" must have "response data of request1".
  6. Click the flag. The first time, allow access to the site. What's the temperature?
  7. Challenge: use "when request request1 fails" to warn when there's no internet. (challenge)

Open in the editor