Web Building Blocks Intermediate
An API is the way one app asks another app for information.
Apps need to talk to each other all the time. A weather app needs weather. A map app needs maps. They get that information through an API.
API stands for Application Programming Interface. That is a big name for a simple idea: a set of rules that lets one app ask another app for something.
Think of a restaurant. You (one app) tell the waiter your order. The waiter takes it to the kitchen (another app), which makes the food and sends it back. The API is the waiter, carrying requests and responses.
So a weather app sends a request like, "What is the weather in my town?" The weather service sends back a response with the answer.
The answer usually comes back in a tidy text format called JSON, which apps find easy to read.
Because of APIs, apps can share superpowers, and you get weather, maps, and messages all in one place.
An API defines how software components communicate. Web APIs typically follow REST conventions over HTTP and exchange JSON. Think of it as a contract: a client sends a request to a defined endpoint, and the service returns structured data, without either side needing to know how the other is built inside.
Want the full story? These go deeper: