100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Web

REST API

BeginnerConcept4.8K learners

A REST API (Representational State Transfer Application Programming Interface) is a web service interface that lets clients and servers communicate over HTTP using a small, standard set of verbs (GET, POST, PUT, DELETE) to create, read,…

Definition

A REST API (Representational State Transfer Application Programming Interface) is a web service interface that lets clients and servers communicate over HTTP using a small, standard set of verbs (GET, POST, PUT, DELETE) to create, read, update, and delete resources identified by URLs.

Overview

REST is an architectural style, not a protocol or a library, first described by Roy Fielding in his 2000 doctoral dissertation. It became the dominant way web applications expose data because it maps naturally onto HTTP: each resource (a user, an order, a product) gets its own URL, and standard HTTP methods describe the action to take on that resource. Responses are typically returned as JSON, though XML and other formats are possible. A well-designed REST API is stateless — each request carries all the information the server needs, with no session stored on the server between calls — and uses standard HTTP status codes (200, 201, 404, 500) to communicate outcomes. This predictability is why REST underpins most public APIs, from payment providers to social platforms, and why it is usually the first API style developers learn, often alongside frameworks like Express.js or FastAPI on the backend and consumed from a React or Vue.js frontend. Over time, alternatives such as GraphQL and gRPC have emerged to address REST's limitations — over-fetching data, versioning difficulty, and rigid endpoint structures — but REST remains the default choice for most CRUD-style applications because of its simplicity, cacheability, and universal tooling support (Postman, Swagger/OpenAPI). Building and testing a REST API is a foundational skill covered in API Design & Best Practices, and the Project: Build a REST API with Python and FastAPI post walks through building one end to end.

Key Concepts

  • Resource-based URLs where each endpoint represents a noun, not an action
  • Standard HTTP verbs (GET, POST, PUT, PATCH, DELETE) map to CRUD operations
  • Stateless requests — no server-side session required between calls
  • Uses standard HTTP status codes to communicate success and error states
  • Supports multiple response formats, though JSON is the de facto standard
  • Cacheable responses via standard HTTP caching headers
  • Documented via specifications like OpenAPI/Swagger for auto-generated docs
  • Layered architecture that works cleanly behind load balancers, gateways, and CDNs

Use Cases

Exposing a database as a web service for mobile and web clients
Powering single-page applications with a JSON backend
Integrating third-party services (payments, maps, weather, auth)
Microservice-to-microservice communication within a backend
Public developer APIs with rate limiting and API keys
Webhooks and event notifications delivered as REST callbacks
CI/CD and infrastructure automation via provider REST APIs
Backend for mobile apps built with React Native or Flutter

Frequently Asked Questions

From the Blog