FastAPI is a web framework designed for building HTTP APIs using type annotations to describe the data expected by application endpoints. It combines request handling from Starlette with data validation and serialization facilities from Pydantic.
The framework connects endpoint definitions with request validation, dependency management and API documentation. Developers can declare parameters and request bodies directly in application functions, allowing FastAPI to interpret incoming data, return structured validation errors and generate documentation.
FastAPI supports both asynchronous and synchronous endpoint functions. It is suitable for REST services, backend applications and systems that need to expose structured APIs to websites, mobile applications or other software.
This is free and open source software.
Key Features
- Automatic request validation and data conversion using type annotations and Pydantic models.
- Generation of OpenAPI schemas and interactive API documentation.
- Dependency injection for managing reusable services, authentication and request-specific resources.
- Support for asynchronous and synchronous path operation functions.
- Typed path parameters, query parameters, headers, cookies and request bodies.
- Response models for validation, serialization and control of returned fields.
- OAuth2, API key, HTTP Basic and HTTP Bearer security utilities.
- WebSocket endpoints for bidirectional communication.
- Server-Sent Events, streaming responses and background tasks.
- Application lifecycle management using lifespan context handlers.
- APIRouter components for grouping endpoints and sharing configuration or dependencies.
- Middleware, exception handlers, Cross-Origin Resource Sharing and mounted applications.
- Testing facilities with dependency overrides and asynchronous test support.
- Support for HTML templates, static files and file uploads.
Website: github.com/fastapi/fastapi
Support:
Developer: Sebastián Ramírez
License: MIT License
FastAPI is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Best Python Micro Frameworks | |
|---|---|
| Flask | Hugely popular microframework based on Werkzeug and Jinja2 |
| FastAPI | Web framework for building APIs |
| Starlette | Lightweight ASGI framework/toolkit |
| aiohttp | Asynchronous HTTP client/server for asyncio and Python |
| Sanic | Web server and web framework |
| Falcon | Build cloud APIs, smart proxies, and app backends |
| Quart | Web microframework based on Asyncio |
| Pyramid | Start small, finish big, stay finished framework |
| Bottle | Fast, simple and lightweight WSGI micro web framework |
| Chalice | Python Serverless Microframework for AWS |
| CherryPy | Mature, minimalist, Python object-oriented web framework |
| TurboGears | Hybrid framework acting as a Full Stack framework or Microframework |
| Quixote | Aimed at sites where complex programming is required |
| Klein | Micro-framework for developing production-ready web services with Python |
| circuits | Lightweight event driven application framework |
| Clastic | Functional web framework |
| Hug | Make developing Python driven APIs as simple as possible |
| MicroPie | Ultra-micro ASGI Python web framework |
| Litestar | Powerful, lightweight, and flexible ASGI framework |
| BlackSheep | Asynchronous Python web framework |
| Robyn | Python web framework designed for high performance |
| Microdot | Small web framework for Python and MicroPython |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.