Like ordering from a menu

A restaurant menu shows what you can order; you do not need to see how the kitchen works. An API serves a similar purpose for software.

For example, a weather app asks a weather service for a forecast. The service sends back the result in an agreed format. The app does not need to know how the forecast was produced.

What the agreement covers

An API defines what an app can ask for, what information it must send, and what answer or error to expect. In a web API, each request goes to a specific endpoint. Long lists may come back in smaller portions through pagination.

This agreement lets the weather service change how it works inside without forcing the app to change. An integration uses a connection such as an API to make separate systems work together. An API can be private, shared with partners, or open to the public; access may still require permission or have request limits.