By Kevin McAleer, 4 Minutes
Page last updated November 24, 2026

Ahoy there makers! Have you ever wanted a web page that shows what your robot is sensing, and lets you switch its LEDs on from your phone, but only if you are logged in? That is exactly what we are going to build, using Python and FastAPI.
FastAPI is a modern Python framework for building web APIs. You describe your routes with ordinary functions and type hints, and FastAPI checks incoming data, converts it and writes interactive documentation for you.
Through this course we build one project, the Robot Telemetry API:
Here is the big picture. The static site never touches the database. It only talks to the API.
flowchart LR
R[Robot or Pico W] -->|POST /readings with token| A[FastAPI app]
S[Static Jekyll site] -->|GET /readings, PUT /leds| A
A --> D[(SQLite database)]
A -->|GET /leds polled by robot| R
After completing this course, you will:
fastapi dev and uvicornAnnotated parametersEach lesson teaches one idea, then adds one piece to the Robot Telemetry API. Code blocks are complete files unless the lesson says “add this”. Terminal commands start with $, and any output we show is real output from the versions below.
The code was tested with FastAPI 0.165, Pydantic 2.14 (Pydantic v2) and Starlette 1.10. Newer versions should behave the same, but if something looks different, check the FastAPI release notes.
Every lesson ends with exercises, common problems and a short quiz. New to Pydantic? The Pydantic course goes much deeper than we need here, and the SQLite3 course covers the database side.
Teachers: This course suits students aged 14 and over who already write Python functions and dictionaries. Allow 45 to 60 minutes per lesson, or two lessons for the longer ones (5 to 7). Everything runs on a laptop, so each learner or pair needs only a computer that lets them install Python packages. If a school machine blocks
pip, ask IT to set up one virtual environment in advance. No robot is needed: a short script plays the part of the robot. Avoid asking learners to use real passwords or real email addresses when they test registration.
import
Comments