API (Application Programming Interface)
What is an API (Application Programming Interface)?
An API (application programming interface) is a contract that lets one program ask another for data or actions, defining allowed requests, formats, responses and errors while hiding how the system works inside.
Updated November 2026 · 4 min read
An API (application programming interface) is a defined way for one piece of software to request data or actions from another. The API sets the rules: which requests are allowed, what format they take, what comes back and what errors look like. When a checkout page charges a card through a payment provider, or a mobile app loads your account from a server, an API is doing the work between them.
The value of an API is that it hides how a system works internally and exposes only a stable contract. The team behind the API can change its database or rewrite its code, and as long as the contract holds, every application built on it keeps working. That contract is why APIs are central to integrations, partner ecosystems, mobile apps and most modern software architecture.
How an API call works
Most web APIs today follow a request and response pattern over HTTP:
- The client sends a request to an endpoint (a URL such as /v1/orders) using a method like GET (read), POST (create), PUT or PATCH (update) or DELETE (remove).
- The request is authenticated, usually with an API key or an OAuth access token, so the server knows who is calling and what they may do.
- The server processes the request and returns a response, typically in JSON, with a status code: 200 for success, 400 for a bad request, 401 or 403 for authorization problems, 404 when the resource does not exist, 429 when the caller has hit a rate limit and 500 for a server error.
Good APIs publish documentation describing every endpoint, parameter and error, often in a machine-readable format such as the OpenAPI Specification.
Types of APIs
By audience
- Private (internal) APIs connect a company's own services and apps.
- Partner APIs are shared with selected companies under an agreement.
- Public (open) APIs are available to outside developers, sometimes free and sometimes paid.
A related term, composite API, describes an endpoint that bundles several calls into one request, which helps when a client would otherwise need many round trips. It can be private, partner or public.
By architectural style
| Style | How it works | Typical use |
|---|---|---|
| REST | Resources addressed by URLs and manipulated with standard HTTP methods. Described by Roy Fielding in his 2000 doctoral dissertation. | Most public web APIs |
| SOAP | XML messages with a strict, formally defined contract | Older enterprise and financial systems |
| GraphQL | The client asks for exactly the fields it needs in a single query. Developed at Facebook and open-sourced in 2015. | Apps that need flexible data from many sources |
| gRPC | Compact binary messages over HTTP/2, with contracts defined in Protocol Buffers | High-volume service-to-service calls |
| Webhooks | The server calls the client when an event happens, instead of the client polling | Notifications such as "payment succeeded" |
Why APIs matter to product teams
- Integrations. Customers expect products to connect with the other tools they use. An API lets partners and customers build those connections without waiting for the vendor.
- Speed of delivery. Teams can buy capabilities such as payments, maps or messaging through APIs rather than build them.
- Architecture. Front-end apps, mobile apps and internal services can share the same back end through one set of APIs.
- Business models. Some companies sell API access directly, priced per call, per seat or by tier. See API monetization strategy.
Worked example: Planning a data sync
Consider a hypothetical CRM vendor whose customer wants to sync 30,000 contact records into a marketing tool each night. The CRM's API returns up to 100 records per page and allows 100 requests per minute per API key.
- Pages needed: 30,000 ÷ 100 = 300 requests.
- Minimum time at the rate limit: 300 ÷ 100 per minute = 3 minutes.
If the customer grows to 600,000 records, the same sync needs 6,000 requests and at least 60 minutes. The product team can respond in several ways: add a filter so the sync only fetches records changed since the last run, offer a bulk export endpoint, or send webhooks when records change. A sync that fetches only changed records, say 2% of 600,000 or 12,000 records a night, needs 120 requests and about 1 minute and 12 seconds at the limit.
Common pitfalls
- Breaking changes without versioning. Renaming a field or changing a response format can break every integration at once. Version the API and give notice before retiring old versions.
- Weak documentation. If developers cannot work out how to make a first successful call, they will not adopt the API, however good it is.
- Exposing internal structure. APIs that mirror database tables are hard to change later. Design around what consumers need.
- Treating security as an afterthought. Broken authorization and excessive data exposure are among the most common API vulnerabilities. See API security.
- No rate limits or monitoring. One misbehaving client can degrade the service for everyone.
Teams that build products around their APIs often adopt an API-first approach and manage them with API management tooling. When an API is itself the product, it usually has a dedicated API product manager.
Frequently asked questions
What is the difference between REST and GraphQL APIs?
A REST API exposes resources at URLs and uses standard HTTP methods such as GET, POST and DELETE to work with them, which is how most public web APIs are built. A GraphQL API lets the client request exactly the fields it needs in a single query, which helps apps that pull flexible data from many sources. GraphQL was open-sourced by Facebook in 2015.
What do common API status codes mean?
A 200 status code means an API request succeeded. A 400 signals a bad request, 401 or 403 an authentication or permission problem, and 404 a resource that does not exist. A 429 means the caller has hit a rate limit, and a 500 indicates an error on the server side. Good API documentation lists every error an endpoint can return.
What is the difference between an API and a webhook?
With a typical API, the client sends a request whenever it wants data and the server responds. With a webhook, the server calls the client when an event happens, such as a payment succeeding, so the client does not need to keep polling. Webhooks suit notifications and syncing changes, and are often offered alongside a regular request-and-response API.
Related terms
Back End
Server-side code, data and services behind what users see.
API Monetization Strategy
Deciding how APIs earn revenue, directly or by supporting a product.
API Security
Controls that keep APIs from exposing data or being abused.
API Product Manager
A product manager whose product is an API used by developers.