
An API, short for application programming interface, is a set of rules that lets one piece of software ask another piece of software to do something. You use APIs constantly without noticing: when a weather app shows today’s forecast, when a shop takes a card payment, or when a website lets you sign in with another account.
The restaurant analogy
Think of a restaurant. You do not walk into the kitchen; you tell the waiter what you want, the waiter passes the order to the kitchen, and then brings back your food. The API is the waiter. It takes a request from one program, delivers it to another system, and returns the result, so neither side needs to know how the other works inside.
Request and response
Most web APIs follow the same pattern. A program sends a request to a specific address, called an endpoint, and the service sends back a response. The request says what is wanted, for example the forecast for a city. The response contains the data, usually in a text format called JSON that both people and programs can read. A simple response might look like this:
{
"city": "Madrid",
"temperature": 21,
"unit": "celsius",
"conditions": "clear"
}
The values above are only an example of the shape of the data, not a real forecast. A weather app asks for this kind of data and then decides how to display it.
Keys, limits and permissions
Many APIs are not completely open. A service may give each developer an API key, a unique code that identifies who is making requests. Keys let the provider control access, set limits on how many requests are allowed, and in some cases charge for heavier use. An API key should be treated like a password: keep it private and never publish it in a public page or repository.
Why APIs matter
- They save work. A developer can use a payment, map or messaging service instead of building one from scratch.
- They connect tools. Automation tools use APIs to move information between apps, such as saving form responses to a spreadsheet.
- They keep systems separate. A service can change how it works internally without breaking the apps that use it, as long as the API stays the same.
What you need to remember
An API is an agreed way for programs to talk to each other: one asks, the other answers, and both follow the same rules. If you use apps that connect to each other, you are already relying on APIs. To go further, look at the documentation of a service you use; it usually lists the available endpoints, the data they return and how to get a key.


