badge icon

This article was automatically translated from the original Turkish version.

Article
Original Author
Sebastián Ramírez (tiangolo)
Developers
Sebastián Ramírez and Community
Platforms
WindowsLinuxMacOS
Initial Release
December 5, 2018
Type
Software Framework
License
MIT License
Official Website
https://fastapi.tiangolo.com/
Code Repository
https://github.com/fastapi/fastapi

FastAPI is a modern, fast, and high-performance Pythonweb framework developed for building HTTP-based API services. It was first initiated by Sebastián Ramírez on December 5, 2018. It can be run on any platform that supports Python and FastAPI components, such as Windows, Linux, and macOS. It is compatible with Python 3.8 and later versions.

Key Features

Speed: It has very high performance and matches the speed of Go, thanks to Starlette and Pydantic. This makes it stand out among other Python API frameworks.

Development Speed: FastAPI accelerates developers’ work through its simplicity.

Reduced Errors: It significantly reduces errors caused by developers.

Auto-completion: It offers extensive editor support and provides auto-complete (IntelliSense) functionality in many different IDEs.

Ease of Use: It is designed with ease of learning and usage in mind, making it ideal for those who already know Python and want to quickly develop APIs.

Brevity: It minimizes code duplication and ensures clean, maintainable code.

Robustness: Code can be deployed to production immediately. Its interactive documentation simplifies the development process.

Standards-Based: FastAPI is built on OpenAPI【1】 (formerly known as Swagger) and JSON Schema【2】, and is fully compatible with them.

Async Support: It supports the async and await keywords for improved performance.

Built-in Security: It includes mechanisms such as OAuth2, JWT, and request validation to protect against common security issues.

Components and Requirements

FastAPI uses Pydantic【3】 for data validation and Swagger【4】 for async functionality:

  • Pydantic: A data validation library for Python. It provides type hints based on docstrings and simplifies debugging through auto-complete functionality.
  • Starlette【5】: A lightweight framework used to support async functionality.
  • Uvicorn【6】: A minimal and low-level web server designed for async frameworks.
  • OpenAPI: FastAPI automatically generates API documentation compliant with the OpenAPI standard (SwaggerUI and ReDoc), allowing developers to test APIs in real time. SwaggerUI is accessible at /docs and ReDoc at /redoc.

Installation

Create and activate a virtual environment. Then, in the terminal with the virtual environment activated, install FastAPI using this command:

This command installs FastAPI along with its standard libraries. If you wish to install only FastAPI, you can use this command instead:

Example

A simple FastAPI application example:

During development, to run the code on your machine (if the file to be executed is main.py), use this command:

or with Uvicorn:

For production, to run the code on your machine (if the file to be executed is main.py), use this command:

or with Uvicorn:

Interactive API Documentation

Documentation generated via SwaggerUI can be accessed at [your-url]/docs, and documentation generated via ReDoc can be accessed at [your-url]/redoc.

Citations

Author Information

Avatar
AuthorMuhammed Nabi YıldızDecember 1, 2025 at 1:00 PM

Tags

Discussions

No Discussion Added Yet

Start discussion for "FastAPI" article

View Discussions

Contents

  • Key Features

  • Components and Requirements

  • Installation

  • Example

  • Interactive API Documentation

Ask to Küre