# fastapi/fastapi

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/fastapi-fastapi).**

99,260 stars · 9,439 forks · Python · MIT

## Links

- GitHub: https://github.com/fastapi/fastapi
- Homepage: https://fastapi.tiangolo.com/
- awesome-repositories: https://awesome-repositories.com/repository/fastapi-fastapi.md

## Topics

`api` `async` `asyncio` `fastapi` `framework` `json` `json-schema` `openapi` `openapi3` `pydantic` `python` `python-types` `python3` `redoc` `rest` `starlette` `swagger` `swagger-ui` `uvicorn` `web`

## Description

FastAPI is a web framework for building APIs with Python. It leverages standard language type hints to provide automatic data validation, request parsing, and interactive API documentation generation. The framework supports asynchronous request handling and manages execution contexts to prevent blocking the main event loop.

The project includes a dependency injection system that allows for the resolution and injection of reusable components into request handlers. This system supports request-scoped caching, lifecycle management, and integration with security mechanisms like OAuth2 and JSON Web Tokens. Developers can organize applications into modular routers and mount sub-applications to manage complex routing logic.

Infrastructure features include middleware support for cross-origin resource sharing, background task management, and static file serving. The framework automatically generates OpenAPI specifications for defined endpoints, which can be customized through metadata and schema extensions. Testing utilities are provided to simulate HTTP and WebSocket connections, allowing for isolated verification of application behavior.

## Tags

### Web Development

- [Full-Stack Frameworks](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/full-stack-frameworks.md) — Coordinates server-side route definitions, application state management, and request processing within a unified framework. ([source](https://fastapi.tiangolo.com/tutorial/first-steps/))
- [Request Body Validations](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/request-body-validations.md) — Enforces data integrity by mapping incoming request payloads to typed models that automatically validate content against defined schemas. ([source](https://fastapi.tiangolo.com/tutorial/body/))
- [Middleware Pipelines](https://awesome-repositories.com/f/web-development/backend-development/middleware-pipelines.md) — Implements a modular interceptor pattern to process requests and manage exceptions throughout the application lifecycle. ([source](https://fastapi.tiangolo.com/advanced/middleware/))
- [Query Parameter Validations](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/query-parameter-validations.md) — Extracts and enforces constraints on query string parameters, including support for aliases, default values, and strict type checking. ([source](https://fastapi.tiangolo.com/reference/parameters/))
- [OpenAPI Response Definitions](https://awesome-repositories.com/f/web-development/api-management-tools/api-development-management/api-documentation/openapi-response-definitions.md) — Enables explicit definition of API response status codes and schemas via decorator configurations. ([source](https://fastapi.tiangolo.com/advanced/additional-responses/))
- [Resource Replacement Strategies](https://awesome-repositories.com/f/web-development/api-management-tools/api-request-handling/resource-replacement-strategies.md) — Facilitates full resource replacement through standard HTTP PUT methods for updating complete data objects. ([source](https://fastapi.tiangolo.com/tutorial/body-updates/))
- [Background Task Managers](https://awesome-repositories.com/f/web-development/backend-development/background-task-managers.md) — Offloads time-consuming operations to run after the HTTP response is sent to the client. ([source](https://fastapi.tiangolo.com/tutorial/background-tasks/))
- [Asynchronous Request Processing](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/asynchronous-request-processing.md) — Processes incoming request bodies using non-blocking methods to efficiently handle large payloads or streaming data. ([source](https://fastapi.tiangolo.com/reference/request/))

### Artificial Intelligence & ML

- [Authenticated User Injection](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/agent-orchestration-multi-agent/security-and-auth/authentication-strategies/request-handling/authenticated-user-injection.md) — Injects authenticated user models directly into request handlers through a flexible, schema-validated dependency system. ([source](https://fastapi.tiangolo.com/tutorial/security/get-current-user/))

### Data & Databases

- [Schema Management Tools](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/schema-management-tools.md) — Declares field-level constraints, metadata, and default values directly within data models to govern structure and validation. ([source](https://fastapi.tiangolo.com/tutorial/body-fields/))

### Development Tools & Productivity

- [Type Hint Integrations](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/workflow-productivity-enhancers/developer-productivity-utilities/developer-experience/type-hint-integrations.md) — Utilizes standard language type hints to drive automated data validation, editor autocompletion, and interactive documentation generation. ([source](https://fastapi.tiangolo.com/python-types/))

### DevOps & Infrastructure

- [Asynchronous Dependencies](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/dependency-injection-systems/asynchronous-dependencies.md) — Handles non-blocking dependency resolution by supporting both synchronous and asynchronous functions within the request lifecycle. ([source](https://fastapi.tiangolo.com/tutorial/dependencies/))
- [Result Caching](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/dependency-injection-systems/result-caching.md) — Caches dependency results per request to ensure shared sub-dependencies execute exactly once. ([source](https://fastapi.tiangolo.com/tutorial/dependencies/sub-dependencies/))

### Part of an Awesome List

- [Developer Tools](https://awesome-repositories.com/f/awesome-lists/devtools/developer-tools.md) — High-performance Python web framework.
- [Python Projects](https://awesome-repositories.com/f/awesome-lists/devtools/python-projects.md) — Listed in the “Python Projects” section of the Awesome For Beginners awesome list.
- [Web and API Tools](https://awesome-repositories.com/f/awesome-lists/devtools/web-and-api-tools.md) — Modern web framework for building APIs.
- [Web APIs](https://awesome-repositories.com/f/awesome-lists/devtools/web-apis.md) — A modern, fast, web framework for building APIs with type hints.
- [Web Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/web-frameworks.md) — High-performance framework for building APIs.
