Web Frameworks & APIs

fastapi

Write a few lines of Python, get a fully documented API website for free.

Install it: pip install fastapi

What does it do?

FastAPI builds the connective tissue that lets apps talk to servers — the invisible plumbing behind an app checking the weather or processing a payment. Its trick is using the descriptions already in your code to automatically generate an interactive webpage where anyone can test the connection by clicking buttons, no separate manual required. It also catches bad or malformed data before it reaches your program, like a bouncer checking IDs at the door. That mix of speed and built-in safety is what made it explode in popularity since its 2018 release.

See it in action

This code sets up a web service that replies with a friendly greeting message whenever its address is visited; it’s started using a separate helper program called Uvicorn.

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def read_root():
    return {"message": "Hello, world!"}

Why would a non-developer care?

Every time an app on your phone fetches fresh data — a delivery tracker updating, a ride-share app finding your driver — something like FastAPI is often working behind the scenes to make that exchange fast and reliable. Faster, safer plumbing means fewer app crashes and quicker feature releases.

Real-world examples

Microsoft, Uber, and Netflix have all publicly discussed using FastAPI for internal and external services. Engineers used to hand-write documentation for every connection point separately, which drifted out of date almost immediately and caused real integration bugs — FastAPI closes that gap by generating the docs directly from the code itself.

Who uses it

Teams building the background services that mobile apps and other software connect to, especially where speed of development and correctness both matter.

How it compares to alternatives

FastAPI is often compared to Flask, which it outpaces on raw speed and automatic documentation, though Flask still has a larger library ecosystem built up over more years. FastAPI sits on top of Starlette for its web handling, so the two are close cousins rather than true rivals.

Fun fact

FastAPI was created by Sebastián Ramírez, known online as ‘tiangolo,’ and it’s benchmarked as one of the fastest Python frameworks available, close to some Node.js and Go frameworks.

New to Python and want to actually try libraries like this yourself?

Find a beginner-friendly course

Related libraries