APIs are the way one program asks another program to do something. API stands for application programming interface. A weather app asks a weather service for tomorrow's forecast, a shopping site asks a payment service to charge a card, and a bank app asks a telecom service whether a SIM was swapped. In each case, one program sends a request in a fixed format and receives a reply in a fixed format.
Here is how it works in general. The company that owns a service decides what others may ask for and publishes the rules: the address to send the request to, the details to include, and the form of the reply. This published description is the API. Another developer writes a program that sends requests as described. The service checks who is asking, often with a secret key, and then does the work and replies. A developer never needs to know how the service works inside, only what to ask and what comes back.
A few terms help. The address a request is sent to is called an endpoint. The reply carries a status number: 200 means success and 404 means not found. The data is usually in a text format called JSON. Services limit how many requests one user may send in a minute. The owner may change the API over time, so it is given version numbers, and old versions are kept for a while. An API is also a door into the service, so keys, limits and checks must protect it. In India, apps reach UPI through APIs in the same way.
Take, for example, an app that sends one-time passwords. It sends a request to an SMS service with the phone number and the message, and the service delivers the SMS; see messaging and voice APIs. Consider a delivery app that asks a map service for the road distance between two places; see location platforms. Say a lender asks a telecom operator whether the phone's SIM was changed in the last day; see network APIs.
APIs are listed and tested with API workspaces and API testing, described with API descriptions, and protected by API gateways and API protection. Companies that sell their service as an API are described in renting the backend.
How is it different from a user interface? A screen is made for a person to read. An API is made for another program to call.
Appears in
- API security↗ Enterprise cybersecurityThe tool studies the calls to a bank's APIs and blocks one that asks for thousands of accounts' data.
- Messaging and voice APIs (CPaaS)↗ Business messaging (CPaaS)An app calls an API with a phone number and message text, and the provider sends the SMS.
- Network APIs↗ Business messaging (CPaaS)A bank's app calls the operator's API to ask if a customer's SIM was swapped in the last day.
- API development platform↗ API and low-code developmentA developer writes an API's description and tries each call in the workspace before the app uses it.
- API gateway↗ API and low-code developmentEvery call from a mobile app goes through the gateway, which checks the key and sends it to the right service.
- API testing↗ Software testingA tester sends thousands of inputs to an API and checks that each answer follows its description.
- Integration platform as a service (iPaaS)↗ Back-office softwareA finance team connects its accounting software to its CRM by drawing a flow, and the platform calls both APIs.
- Banking APIs↗ Digital bankingA company calls an API to fetch a customer's bank statement with consent, rather than building the link itself.
- FHIR APIs↗ Health data interoperabilityA health app asks the hospital's FHIR API for a patient's allergies and gets them in a standard format.
- Utility data API↗ Rooftop solarA solar firm calls an API to pull a customer's electricity bill data from the utility.