MyLeoNes™

APIs: programs talking to programs — Technology, 14–17 years

How one piece of software requests a service from another without knowing its inner code. Technology, 14–17 years.

A clear doorway

An API is an agreed way for one program to ask another program for something. It names the request, the information to send and the shape of the reply. Like a café menu, it lets you order a service without needing to know how the kitchen works.

Why use an API?

Without an API, every app would need to understand the private workings of every service it uses. That would make changes risky and would force teams to rebuild the same features. An API creates a boundary: the service can improve inside while keeping the promised requests and replies stable.

Asking for weather

A weather app needs today’s temperature for Lisbon. First, it sends a request naming Lisbon and the unit Celsius. The weather service checks its data and returns, for example, 18 °C plus a status such as “OK”. The app then displays that reply; it never needs access to the service’s database tables.

An API is not unlimited access

It is easy to think that an API lets any program ask for anything. That is reasonable because the doorway hides the service’s inner workings. In reality, the provider may require a key, limit requests, hide private fields or return an error when the request is invalid. The published agreement matters.

Services working together

Maps, payment pages, travel apps and school platforms often use APIs. A shop may use one service to calculate delivery, another to accept a card payment and a third to show a map. This is useful when each service has a clear job, but it also creates dependence: one service changing its API can affect many apps.

Keep exploring

Other languages

Loading MyLeoNes™…