FastAPI
A modern, fast Python framework for building APIs.
FastAPI uses Python type hints to generate automatic request validation, OpenAPI documentation, and JSON serialisation. A function annotated with Pydantic models becomes a fully documented API endpoint with input validation, output serialisation, and a Swagger UI page — without writing boilerplate code. The framework is built on Starlette (an ASGI web framework) and Pydantic.
Sebastián Ramírez released FastAPI in 2018. The framework grew quickly because it fitted well with two trends: type-hinted modern Python and the move from WSGI to ASGI. Performance is strong by Python standards — comparable to Node.js for typical I/O-bound workloads — and the developer-experience focus has attracted a large user base.
FastAPI is now one of the most popular Python web frameworks for new API projects, especially in machine-learning model serving where the type-hint-driven docs make it easy to expose a model behind a self-documenting HTTP interface. Major adopters include Uber, Netflix, and Microsoft.
Install
pip install "fastapi[standard]"
Authors
- Sebastián Ramírez (creator)