How it works · 18 of 36 Foundation
What is an API, and how do apps use one?
A menu one program offers others
API: An API is a set of requests a service promises to answer, so other programs can use it without knowing how it works inside.
Loading the animation…
Say it like this An API is a menu one program offers others: a fixed list of requests it promises to answer, so apps can use the service without seeing how it works inside.
Under the hood — for builders
- Real case: what a weather API charges
- Many apps show weather without running a single weather station. They call a weather service's API, and the menu has prices. One published example:
- What one order looks like
- An API call is an ordinary HTTP request. The answer usually comes back as JSON, a plain-text format for data:
- When the limit is hit
- Rate limits protect a service from one app hogging it. The standard answer has its own status code, and the standard's own example:
- API key
- A secret string sent with each call so the service knows which app is ordering, and whom to bill.
- Measure it
- Most API dashboards show calls per day against the free quota. Check it before launch, not after the bill.
- Watch out
- Never put an API key inside a website's or app's code where users can read it: anyone can copy it and spend your quota.
- Sources
- OpenWeather pricing (One Call API). RFC 6585 (429). RFC 8259 (JSON). Read 28 Nov 2026.
What happens in the APIs animation, step by step?
- A travel app doesn't run its own trains, maps or payments. It orders each one from another service, through that service's API.
- An API is the service's menu: the exact requests it promises to answer, like "GET /trains?from&to", and the shape of each answer.
- Your turn: build the app. Tap to order each piece from its service.
- Behind the hatch, the train service rebuilds its whole kitchen. The menu stays the same, so the app keeps working and never knows.
- Menus come with rules: a key that says who's ordering, and limits. Order too fast and the answer is 429: too many requests, try later.
- An API is a menu one program offers other programs. Next: how do chat apps get new messages instantly?
What everyday example explains APIs?
A restaurant menu: you order by name; the kitchen is hidden.
Why should a team care about APIs?
Most apps are built by joining other services' APIs; their limits and prices shape what the app can do.