The short answer
An API, or application programming interface, is a defined way for one piece of software to talk to another: to ask for data or ask it to do something, and get a predictable answer back. When an app shows a map, takes a card through a payment provider, or sends a text message, it is calling someone else’s API. Your own product usually has an API too: the mobile app and website talk to your server through it.
Key points
- An API is a contract: send this request, get this response.
- Most products both use other APIs and have their own.
- Web APIs usually work over HTTPS and return JSON.
- Keys and permissions control who may call an API.
- A documented API makes integrations and future apps easier.
The idea
MDN describes an API as a set of features and rules inside a software program that lets other software interact with it. A useful picture is a restaurant menu: you do not walk into the kitchen; you order from a fixed list, in an agreed way, and get a dish back. The kitchen can change how it cooks without changing the menu.
Everyday examples
| When your product… | It calls… |
|---|---|
| Shows a map or directions | A maps API |
| Takes a card | A payment provider’s API |
| Sends an email or text | An email or messaging API |
| Signs users in with Google | Google’s sign-in API |
| Answers questions with AI | A model provider’s API |
| Loads a user’s orders in the app | Your own API |
How a web API call works
- The app sends a request over HTTPS to an address, for example asking for order 42.
- It includes a key or sign-in token that proves who is asking.
- The server checks permissions, does the work, and replies, usually in JSON.
- The reply includes a status: success, not found, not allowed, or an error.
Common styles include REST and GraphQL. See REST vs GraphQL. When a service needs to tell you something happened, it calls you instead, with a webhook. See API vs webhook.
What founders should ask
- Is our API documented, so another developer or partner could use it?
- Who holds the keys to the outside APIs we depend on, and are they in the company’s accounts?
- What happens if an outside API is down or changes its price?
- Are permissions checked on the server for every request?
- Could we add a mobile app or partner integration later without rebuilding the backend?
APIs that serve a website, a mobile app and partners from one backend are part of web app development.
Sources
Checked when this guide was written.