FastAPI

FastAPI is a modern, fast (high-performance) web framework for building APIs with Python 3.7+ based on standard Python type hints. It leverages Starlette for the web parts and Pydantic for data validation and serialization, providing automatic interactive API documentation (OpenAPI/Swagger UI…

Key facts

First appeared
2018
Category
web_framework
Problem solved
Before FastAPI, Python developers building APIs often faced a dilemma: choose a mature synchronous framework like Flask or Django REST Framework, which might require extensive boilerplate for validation and documentation and lacked native async support, or opt for a newer async framework like Sanic or Starlette, which offered performance but often required more manual effort for data handling and documentation. FastAPI solved this by elegantly combining the best of both worlds: high performance via ASGI, automatic data validation and serialization using Python type hints (Pydantic), and out-of-the-box OpenAPI documentation, thereby drastically reducing development time and improving API robustness.
Platforms
Windows, Linux, macOS

Related technologies

Notable users

  • Netflix
  • Microsoft
  • FastAPI is widely used by startups and companies in data science and AI fields.
  • Uber