Skip to content
PlayOwl

Coding · Grade 8

APIs with Controlled Mock Services

Learners discover how programs request data from other programs through APIs, using a local mock weather service so that no real network calls are made. They read requests, responses, status codes and JSON, parse JSON in Python, write code that checks status codes and missing fields with safe fallbacks and caching, and use APIs responsibly by protecting keys, minimising personal data and respecting limits.

  • 4 lessons
  • About 85 minutes
  • Check what you learned: 8 questions
  • Ways to answer: choose an answer, put code in order, trace code, highlight a text, match pairs and sort into groups
See plans Included with Family, Teacher and School plans. Open in PlayOwl

What learners will discover

  • Explain API requests and responses, including endpoints, parameters, status codes and JSON bodies.
  • Parse JSON text into Python values and use the resulting dictionaries and lists.
  • Handle API failures robustly by checking status codes and fields, using fallbacks and caching to respect rate limits.
  • Use APIs responsibly: protect keys, send minimal personal data, respect terms and limits, and test with mocks.

Lessons

  1. What an API is 5 steps2 practiceabout 20 min
  2. Using JSON data in Python 5 steps3 practiceabout 22 min
  3. Handling errors and limits 5 steps3 practiceabout 20 min
  4. Using APIs responsibly 4 steps2 practiceabout 18 min
  5. Check what you learned 8 questions at the end

Keep exploring

Games to practice with

More 8th grade coding

Guide for grown-ups