FastAPI

FastAPI is an open-source Python web framework created by Sebastián Ramírez and now maintained with a large open-source community. It's the #9 most-used web framework overall, reported in roughly 14.8% of developer surveys, and the fastest-rising framework in the Python ecosystem. Developers reach for it because it generates interactive OpenAPI/Swagger documentation automatically from your code's type hints, while also delivering async performance close to Node.js and Go.

Quick facts
Type: Async web API framework
Made by: Sebastián Ramírez / open-source community
License: Free / open-source (MIT)
Language: Python
Primary use case: High-performance REST/JSON APIs with automatic interactive docs
Jump to: ExampleGetting startedBest for

Example

A minimal FastAPI app defines routes with plain Python type hints — FastAPI uses those hints to validate requests and build the docs page automatically.

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class Item(BaseModel):
    name: str
    price: float
    in_stock: bool = True

@app.get("/items/{item_id}")
async def read_item(item_id: int, q: str | None = None):
    return {"item_id": item_id, "q": q}

@app.post("/items")
async def create_item(item: Item):
    return {"created": item.name, "price": item.price}

Getting started

Install FastAPI with an ASGI server, then run the app with hot reload.

# install FastAPI + Uvicorn server
pip install fastapi uvicorn

# run with auto-reload (main.py contains `app = FastAPI()`)
uvicorn main:app --reload
Best for: Backend APIs and microservices where you want type-checked request/response validation, automatic Swagger docs for frontend or mobile teams, and native async support for high-concurrency workloads like ML model serving.