Tools & DevOps · reviewed in July 2026
REST API
A REST API is an interface that lets two programs talk over HTTP, using URLs to identify resources and verbs like GET, POST, PUT and DELETE to act on them. It is the most common style for exposing data and functionality on the web, and it usually exchanges information as JSON.
from fastapi import FastAPI
app = FastAPI()
@app.get("/orders/{order_id}")
def get_order(order_id: int):
return {"id": order_id, "total": 149.90}Frequently asked questions
What makes an API RESTful?
It follows a set of conventions: each resource has its own URL, operations are expressed with HTTP verbs, and responses don't depend on state kept between requests. That makes it predictable and easy to consume from any language.
How is a REST API different from GraphQL?
REST exposes several endpoints, one per resource, and returns fixed shapes; GraphQL exposes a single endpoint where the client asks for exactly the fields it needs. REST is simpler to cache and reason about; GraphQL avoids over-fetching.
What do you build a REST API with in Python?
FastAPI is a widely used option: you define endpoints as Python functions, validate input and output with Pydantic, and get OpenAPI documentation generated automatically.