Glossary/REST API
    APIs & Protocols

    What is REST API?

    A REST API (Representational State Transfer) is an architectural style for building web APIs that uses standard HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources identified by URLs.

    Last updated: February 2026

    REST API Explained

    REST (Representational State Transfer) is the most widely used architectural style for web APIs. Created by Roy Fielding in 2000, REST uses standard HTTP methods to perform CRUD operations on resources. Each resource has a unique URL, and the API is stateless—meaning each request contains all the information needed to process it. RESTful APIs are the industry standard for web and mobile development because they're simple, scalable, and universally understood. At M3L Software, we build REST APIs with FastAPI that follow best practices: proper HTTP status codes, pagination, filtering, HATEOAS links, and comprehensive OpenAPI documentation.

    Key Features

    Uses standard HTTP methods (GET, POST, PUT, PATCH, DELETE)
    Stateless communication between client and server
    Resource-based URLs (/users, /orders/123)
    JSON as the primary data format
    HTTP status codes for response semantics
    Built-in caching via HTTP headers

    Common Use Cases

    1
    Web application backends
    2
    Mobile app APIs
    3
    Third-party developer platforms
    4
    Microservices communication
    5
    CRUD operations for data management

    Code Example

    python
    from fastapi import FastAPI, HTTPException
    from pydantic import BaseModel
    
    app = FastAPI()
    
    class UserCreate(BaseModel):
        name: str
        email: str
    
    users_db = {}
    
    @app.get("/users")
    async def list_users(skip: int = 0, limit: int = 10):
        items = list(users_db.values())[skip:skip + limit]
        return {"users": items, "total": len(users_db)}
    
    @app.get("/users/{user_id}")
    async def get_user(user_id: int):
        if user_id not in users_db:
            raise HTTPException(status_code=404, detail="User not found")
        return users_db[user_id]
    
    @app.post("/users", status_code=201)
    async def create_user(user: UserCreate):
        user_id = len(users_db) + 1
        users_db[user_id] = {"id": user_id, **user.dict()}
        return users_db[user_id]

    A RESTful API built with FastAPI demonstrating proper HTTP methods, status codes, pagination, error handling with HTTPException, and Pydantic models for input validation.

    Frequently Asked Questions

    What makes an API RESTful?

    A RESTful API follows REST constraints: client-server separation, statelessness, cacheability, uniform interface (resource-based URLs, standard HTTP methods), and layered system architecture.

    Is REST better than GraphQL?

    Neither is universally better. REST is simpler, more cacheable, and better for simple CRUD operations. GraphQL excels when clients need flexible data fetching and you want to avoid over/under-fetching. Many companies use both.

    What are common REST API best practices?

    Use nouns for URLs (/users not /getUsers), proper HTTP methods, meaningful status codes, pagination for lists, versioning (v1/users), consistent error formats, and comprehensive documentation.

    Related Terms

    Need Help with REST API?

    M3L Software specializes in apis & protocols. Get expert implementation with founding client pricing (50% off).

    Have a Project in Mind?

    Book a free 30-minute call to discuss your project. No sales pitch — just honest technical guidance from a senior engineer.

    Free Consultation
    Fast Turnaround
    Money-Back Guarantee