This article was automatically translated from the original Turkish version.
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.
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.
FastAPI uses Pydantic【3】 for data validation and Swagger【4】 for async functionality:
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:
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:
Documentation generated via SwaggerUI can be accessed at [your-url]/docs, and documentation generated via ReDoc can be accessed at [your-url]/redoc.
[1]
OpenAPI Initiative. “OpenAPI Specification.” OpenAPI resmi web sitesi. Erişim: 11 Ağustos 2025. https://www.openapis.org/.
[2]
JSON Schema Working Group. “JSON Schema.” Resmi JSON Schema web sitesi. Erişim: 11 Ağustos 2025. https://json-schema.org/.
[3]
Samuel Colvin. "Pydantic." Pydantic resmi sitesi. Erişim 11 Ağustos 2025. https://pydantic.dev/.
[4]
SmartBear Software. "Swagger." Swagger resmi sitesi. Erişim: 11 Ağustos 2025. https://swagger.io/.
[5]
Tom Cristie. "Starlette." Starlette resmi sitesi. Erişim: 11 Ağustos 2025. https://www.starlette.io/.
[6]
Tom Christie. "Uvicorn." Uvicorn resmi sitesi. Erişim: 11 Ağustos 2025. https://www.uvicorn.org/.
Key Features
Components and Requirements
Installation
Example
Interactive API Documentation