Web API

A web API is an application programming interface that one program calls over a network using web protocols, almost always HTTP or HTTPS. Where a library API is a set of in-process function calls, a web API is a contract between separate systems: a client sends a request to a URL, and a server returns a structured response, typically JSON or XML. The web API is the unit of integration that lets a mobile app, a single-page application, or another server consume a service without sharing its code or database.

The idea grew directly out of the architecture of the web itself. Roy Fielding’s 2000 dissertation, which named the REST architectural style, framed the web as a client-server system of addressable resources manipulated through a uniform interface, and that framing became the template for exposing application functionality, not just documents, over the same plumbing. By the mid-2000s “web API” had largely come to mean an HTTP interface to a program, and the explosion of REST APIs over JSON made the web the default integration substrate.

A web API comes in several styles. REST organizes the interface around resources and HTTP verbs; SOAP wraps remote procedure calls in XML envelopes; GraphQL exposes a single endpoint with a typed query language; gRPC uses binary Protocol Buffers over HTTP/2 for high-performance service-to-service calls. Despite their differences, all share the web API’s defining traits: a network boundary, a published contract, versioning to manage change, and authentication and authorization to control access.

Because the contract is what other developers build against, web APIs are increasingly treated as products in their own right, described in machine-readable form with the OpenAPI Specification or its equivalents and documented for a developer audience. This productization of the web API — companies exposing capabilities like payments, messaging, or maps as callable services — is the foundation of the modern API economy and of the microservice and integration architectures that dominate contemporary software.