Technical

API

Programming interface that lets two applications communicate in a standardized way. The foundation of modern software architecture.

Deux cubes en métal brossé face à face sur un sol sombre, reliés au centre par une fiche et une prise cylindriques bordeaux qui s'emboîtent dans une gerbe de petites étincelles, faisceau de lumière tombant du haut
API — Image générée par IA (Qwen-Image 2.1, ComfyUI local)

API (Application Programming Interface) is a software interface that lets two applications communicate in a standardized way. An API defines which requests are possible, the data formats exchanged, and the authentication rules. It acts as a contract between the service provider and the consumer, ensuring interoperability and room to evolve. APIs are the foundation of modern software architecture.

Technical definition

REST architecture

REST APIs (Representational State Transfer) are the most widespread API style in production. They rely on HTTP and its standard verbs: GET (read), POST (create), PUT (full replace), PATCH (partial update), DELETE (remove). Resources are identified by URLs (e.g. /users/123) and responses are most often JSON, sometimes XML.

REST imposes 6 architectural constraints: client-server (separation of concerns), stateless (each request stands on its own), cacheable (performance optimization), uniform interface (standardized URLs), layered system, and code on demand (optional). This architecture makes horizontal scaling easier and can serve very large request volumes.

Architectural alternatives

GraphQL (created at Facebook) lets clients specify exactly which fields they want through a query language, eliminating REST's over-fetching. GitHub and Shopify have adopted it for their public APIs. gRPC (Google) uses Protocol Buffers and HTTP/2 for high-performance binary communication, more compact and faster than REST/JSON, ideal for internal microservices.

WebSockets keep a permanent two-way connection open for real-time use cases (chat, push notifications). Webhooks send HTTP POST notifications when an event occurs (payment confirmed, new Git commit). SOAP (legacy) uses XML over HTTP with a strict WSDL contract and is still found in finance and healthcare for regulatory compliance.

Standards

OpenAPI Specification (OAS)

The industry standard for documenting REST APIs, maintained by the OpenAPI Initiative (Linux Foundation). OAS 3.1 (2021) describes endpoints, parameters, request/response schemas, authentication and examples in a machine-readable YAML/JSON format. The major cloud providers publish OpenAPI descriptions for many of their services.

Generator tools (Swagger Codegen, OpenAPI Generator) automatically produce client SDKs in dozens of languages along with interactive documentation. The specification enables versioned API contracts and automated testing through schema validation.

JSON Schema and JSON:API

JSON Schema validates the structure of JSON payloads with types, constraints and descriptions. JSON:API standardizes pagination, filtering, sorting and the inclusion of related resources in REST responses, removing design ambiguity. Its conventions include data, included, meta and links as top-level keys.

Current challenges and key figures

The API economy

The API management market (gateways, developer portals, analytics) is growing steadily: it will reach $13.7 billion in 2027 according to MarketsandMarkets. API-first companies such as Twilio, Stripe and Algolia have built their business model on the API itself: the interface is the product.

Performance and scalability

A well-optimized REST API responds within a few dozen milliseconds, and you should watch high percentiles (p95, p99) rather than the average alone. Native HTTP caching with ETag and Cache-Control sharply reduces server load. CDNs (Cloudflare, Fastly) bring endpoints closer to users. Canary deployments make it possible to ship API changes continuously without downtime.

Security and governance

APIs have become one of the main attack surfaces of applications. BOLA attacks (Broken Object Level Authorization), at the top of the OWASP API Security Top 10 2023, consist of accessing other users' resources by tampering with IDs (/users/123 → /users/124). Smart rate limiting (per IP, token or endpoint) curbs abuse, but it is no substitute for an authorization check on every object.

Practical applications

E-commerce and payment integrations

Stripe is often cited as the benchmark payment API: webhooks for asynchronous notifications (payment accepted/declined), idempotency keys for safe transactions, and dated versions so that existing integrations never break. Merchants integrate payments quickly thanks to the official SDKs and Stripe Elements (UI components).

PayPal, Adyen and Mollie offer similar APIs with PCI DSS Level 1 certification. Fees vary with volume and region. In Europe, strong customer authentication (3D Secure 2) is required by the PSD2 directive.

SaaS platforms and integrations

Salesforce connects CRM, marketing automation and analytics through REST, SOAP and the Bulk API for batch processing. The Composite API bundles several subrequests into a single network call. OAuth 2.0 with refresh tokens keeps things secure without users re-entering credentials. Salesforce events notify third-party systems when opportunities are created or updated.

The Slack API applies per-method rate limits, with bursts tolerated. Slack Apps use the Events API (real-time webhooks) and the Web API to automate workflows. Microsoft Graph unifies access to Microsoft 365, Teams, SharePoint and OneDrive through a single endpoint.

Microservices and distributed architecture

Uber orchestrates thousands of microservices that talk to each other through internal APIs (gRPC for latency-critical paths, REST for business services). A central API gateway routes traffic with circuit breakers and retry logic. A service mesh (Envoy) handles mutual TLS, distributed observability (OpenTelemetry) and canary deployments.

Amazon made the API its internal rule: every team exposes its data and functionality only through service interfaces, a principle that made AWS possible. Netflix brings many microservices together behind a federated GraphQL API that aggregates data from multiple sources in a single request.

Standards and Specifications

RFC 9110 (HTTP Semantics)

Official specification of HTTP semantics, the protocol underlying REST APIs

OpenAPI Specification 3.1

Standard for documenting and designing REST APIs

JSON:API

Convention for structuring the JSON responses of REST APIs

Frequently Asked Questions

What is the difference between REST and GraphQL?

REST exposes several fixed endpoints (e.g. /users, /posts), whereas GraphQL routes every request through a single endpoint using a structured query. REST can lead to over-fetching (downloading data you don't use) or under-fetching (needing several requests).

REST remains by far the most widespread API style, thanks to its simplicity and maturity. GraphQL is mostly chosen for complex architectures, when clients (mobile apps, rich front ends) need a lot of flexibility in their queries.

How do you secure an API?

Common safeguards include: mandatory HTTPS (TLS 1.3 encryption), API key authentication (simple but limited), OAuth 2.0 (the standard for delegated authorization), JWT (self-contained stateless tokens), and rate limiting (request quotas per client).

The OWASP API Security Top 10 2023 lists the critical vulnerabilities, led by Broken Object Level Authorization (BOLA), followed by broken authentication, broken object property level authorization and unrestricted resource consumption. Well-secured APIs also enforce strict input validation and monitor for anomalies.

What is a public API versus a private API?

A public API is open to any external developer (e.g. Google Maps, Stripe), with public documentation and key-based authentication. A private API is reserved for a company's internal systems and is never exposed externally.

Partner APIs sit in between: they are available only to specific business partners under contractual agreements. In most organizations, private APIs are by far the most numerous: public APIs are only the tip of the iceberg.

How do you version an API?

There are three main approaches: versioning in the URL (/v1/users, /v2/users), via an HTTP header (Accept: application/vnd.api.v2+json), or with a query parameter (?version=2).

URL versioning is the most common because it is simple and visible. Major versions break compatibility (breaking changes), minor versions add features (backward compatible). Stripe popularized another approach: dated versions, with each account staying pinned to its version until it chooses to upgrade.

Resources and Documentation