FastAPI is a modern, fast (high-performance) web framework for building APIs with Python 3.8+ based on standard Python type hints. It was created by Sebastián Ramírez and has become one of the most popular Python frameworks for building REST APIs.
FastAPI is built on top of two libraries:
It runs on ASGI (Asynchronous Server Gateway Interface) servers such as Uvicorn or Hypercorn, which is what allows it to handle many concurrent requests efficiently.
/docs and ReDoc at /redoc, generated from the OpenAPI schema (/openapi.json).Depends) for sharing logic like database sessions or authentication.async def endpoints for I/O-bound workloads.A: No. You can write endpoints with normal def and FastAPI runs them in a thread pool, or with async def and it runs them on the event loop. You can mix both in the same application.
A: ASGI is the async successor of WSGI. While WSGI (used by Flask/Django traditionally) handles one request per worker at a time, ASGI supports asynchronous, long-lived connections (WebSockets, SSE) and thousands of concurrent connections on a single process.
A: FastAPI automatically generates an OpenAPI schema describing every path, parameter, request body and response. That schema powers the interactive docs and can be used to generate client code in other languages.
FastAPI combines speed, type safety, automatic validation and automatic documentation in one framework. Understanding its pillars (Starlette for the web layer, Pydantic for data, Uvicorn as the ASGI server) is the foundation for everything else in this course.