61 interactive lessons · free
Learn FastAPI by writing FastAPI.
Not videos. Not snippets to copy. Every lesson is an exercise you complete in a real editor, checked by a real test suite, running a real FastAPI server — inside your browser tab.
Don't believe it? Hit Run for real in the editor — it boots an actual Python 3.12 server in this tab and sends the request.
1from fastapi import FastAPI2 3app = FastAPI()4 5@app.get("/users/{user_id}")6async def get_user(user_id: int, q: str | None = None):7 return {"user_id": user_id, "q": q} Outputexample response
GET/users/42?q=hi200 OK
{"user_id": 42, "q": "hi"}
- lessons
- 61
- tracks
- 3
- install steps
- 0
- python
- 3.12
- runs in
- your browser
Curriculum
61 lessons across 3 tracks — first route to auth, databases, WebSockets and testing. Start anywhere.
FastAPI Basics
beginner45 lessons · 42 hours- 01First Steps
- 02Path Parameters
- 03Query Parameters
- 04Request Body
- 05Query Parameters and String Validations
- 06Path Parameters and Numeric Validations
- 07Body - Multiple Parameters
- 08Body - Fields
- 09Body - Nested Models
- 10Extra Data Types
- 11Cookie Parameters
- 12Header Parameters
- 13Query Parameter Models
- 14Cookie Parameter Models
- 15Header Parameter Models
- 16Response Model - Return Type
- 17Extra Models
- 18Response Status Code
- 19Request Forms
- 20Request Files
- 21Request Forms and Files
- 22Request Form Models
- 23Handling Errors
- 24Path Operation Configuration
- 25Schema Extra - Examples
- 26JSON Compatible Encoder
- 27Body - Updates
- 28Dependencies - First Steps
- 29Classes as Dependencies
- 30Dependencies - Sub-dependencies
- 31Dependencies - Path Operation Decorators
- 32Dependencies - Global Dependencies
- 33Dependencies with Yield
- 34Security - First Steps
- 35Security - Get Current User
- 36Security - Simple OAuth2
- 37Security - OAuth2 with JWT Tokens
- 38Middleware Basics
- 39CORS Middleware
- 40SQL Databases with SQLModel
- 41Bigger Applications - Multiple Files
- 42Background Tasks
- 43Metadata and Docs URLs
- 44Static Files
- 45Testing
Build a Blog API with Authentication
intermediate6 lessons · 5 hoursAdvanced FastAPI Patterns
advanced10 lessons · 8 hours- 01Async Endpoints & Concurrency
- 02Async Dependencies & Lifespan
- 03WebSocket Basics
- 04WebSocket Rooms & Broadcasting
- 05Custom Middleware & Request Processing
- 06Rate Limiting with Dependencies
- 07Response Caching Patterns
- 08Custom Response Types
- 09Application Events & Startup Logic
- 10API Versioning & Router Composition
Why this beats reading the docs
- runtime
- A real FastAPI server, not a simulation. Routes, validation errors and status codes behave exactly as they do in production.
- grading
- Every exercise ships a test suite. Write the code, run it, and get told precisely what is missing.
- setup
- None. No virtualenv, no Docker, no dependency conflicts — the runtime boots in the tab.
- projects
- Later tracks use real layouts with routers, models and dependencies across modules.
- client
- A built-in request client and live Swagger UI exercise the endpoints you just wrote.
- solutions
- A worked solution and a hint on every exercise, so a hard lesson costs minutes, not the session.
Get new lessons in your inbox
New tutorials and platform updates. No spam, unsubscribe anytime.
