Skip to main content

Welcome to FastAPI

FastAPI is a modern, fast (high-performance) web framework for building APIs with Python based on standard Python type hints.

What is FastAPI?

FastAPI is designed to help you build robust APIs quickly and efficiently. It combines the best aspects of Python’s type system with automatic API documentation, making it one of the most developer-friendly frameworks available.

Get started

Install FastAPI and set up your development environment

Quick start

Build your first API in minutes

First steps

Learn the fundamentals with our tutorial

API reference

Explore the complete API documentation

Key features

Type-driven development

FastAPI leverages Python’s type hints to provide automatic validation, serialization, and editor support. Write type-safe code with full autocompletion.

Automatic interactive documentation

Every FastAPI application comes with automatically generated, interactive API documentation at /docs (Swagger UI) and /redoc (ReDoc). No configuration required.

High performance

FastAPI is built on Starlette and Pydantic, making it one of the fastest Python frameworks available. Performance is on par with NodeJS and Go.

Dependency injection

Powerful and intuitive dependency injection system that makes it easy to manage dependencies, share code, and implement security patterns.

Security and authentication

Built-in support for OAuth2, JWT tokens, HTTP Basic authentication, API keys, and more. Security utilities make it simple to protect your endpoints.

Standards-based

Based on open standards for APIs: OpenAPI (formerly Swagger) and JSON Schema. This means automatic client code generation and integration with existing tools.

Why choose FastAPI?

FastAPI combines speed of development with runtime performance, helping you build production-ready APIs faster while maintaining high standards.
Key benefits include:
  • Fast to code: Increase development speed by 200-300%
  • Fewer bugs: Reduce developer-induced errors by approximately 40%
  • Intuitive: Great editor support with completion everywhere
  • Easy: Designed to be easy to use and learn
  • Robust: Get production-ready code with automatic documentation

Requirements

FastAPI stands on the shoulders of giants:
  • Starlette for the web parts
  • Pydantic for the data validation and settings management
FastAPI requires Python 3.10 or higher.

Next steps

Ready to get started? Follow our installation guide and build your first API:
1

Install FastAPI

Follow the installation guide to set up FastAPI
2

Build your first API

Complete the quick start guide to create a working API
3

Learn the fundamentals

Work through the first steps tutorial