talira

FastAPI framework, high performance, easy to learn, fast to code, ready for production

open sourceMITfree

FastAPI is a modern, high-performance web framework for building APIs with Python based on standard type hints. You declare path, query and body parameters with type annotations, and FastAPI validates requests with Pydantic, serializes responses, and generates an OpenAPI schema with interactive documentation (Swagger UI and ReDoc) automatically; the web layer is Starlette, so it supports async endpoints, WebSockets, background tasks and dependency injection. It is one of the fastest Python frameworks in independent benchmarks when run under Uvicorn. FastAPI Cloud, a hosting service from the same team, is the project's main sponsor, and FastAPI apps deploy to any cloud as well.

Problems it solves

  • build a REST API in Python with automatic request validation
  • get interactive OpenAPI docs for my Python API without writing them by hand
  • a fast async Python web framework for serving machine learning model predictions
  • declare request parameters and bodies with Python type hints and get editor autocompletion
  • a modern replacement for Flask when building JSON APIs
  • inject database sessions and auth checks into API endpoints cleanly
  • generate client SDKs from my Python API's OpenAPI schema
  • serve WebSockets and background tasks from a Python API

Features

  • request validation from type hints with Pydantic
  • automatic OpenAPI schema and JSON Schema
  • interactive API docs with Swagger UI and ReDoc
  • async and sync endpoints
  • dependency injection
  • WebSockets and background tasks
  • security utilities for OAuth2 and API keys
  • FastAPI CLI for running apps
  • official agent skill for AI coding agents

Alternatives

The same job

These do what FastAPI does.

  1. Flask A lightweight WSGI web application framework for Python
  2. Django REST framework A powerful and flexible toolkit for building Web APIs

Compare FastAPI with the top 3