What FastAPI is
FastAPI is a Python framework for building web APIs: programs that other programs (a website, a phone app, another service) talk to over HTTP and get JSON back.
Why people pick it
- Type hints do the work. You write normal Python type hints, and FastAPI uses them to read the request, check it, convert it, and document it.
- Validation for free. If a client sends
"abc"where you asked for anint, FastAPI answers with a clear422error before your code even runs. - Docs for free. Every API gets interactive docs at
/docs(Swagger UI) and/redoc, built from an OpenAPI description at/openapi.json. - Fast. It runs on ASGI servers like Uvicorn and supports
async, so one process can handle many requests that are waiting on a database or another API.
What it's built on
| Piece | Job |
|---|---|
| Starlette | The web toolkit: routing, requests, responses, WebSockets, middleware |
| Pydantic | Data models and validation |
| Uvicorn | The ASGI server that actually listens on a port |
You will mostly use FastAPI's own API, but knowing these three pieces helps when you read error messages and docs.
What you'll build in this course
By the end you'll have a real API with a database, logins, tests, background work, WebSockets and a Docker image ready for production. Each module ends with a task where you build a piece of it.