What is an API call, and how does one program ask another for something?
Every time an app shows you the weather, a program has politely asked another program a question. The agreed way of asking is called an API.
βΆ Start the storyIt is a message to another program, sent in an agreed format, that gets an answer back. An application programming interface, or API, is a connection between computers or between computer programs: a piece of software offering a service to other pieces of software. A program that uses one part of it is said to call it, and the parts are also called requests or endpoints.
Wikipedia's example is a weather sensor. When a certain message is sent to the sensor, it detects the current conditions and replies with a weather report. The message is the API call and the report is the API response. A weather app can ask many such sensors and combine the answers, without knowing anything about how each one measures.
Step 1: Call
A program sends a request in the agreed format.
Step 2: Service
The other program does the work, hidden from view.
Step 3: Response
A structured answer comes back, often as JSON.
That is the point of an API: it hides the internal details of a system and exposes only the useful parts, keeping them consistent even if the insides later change. Unlike a user interface, which connects a computer to a person, an API connects software to software, so it is not meant to be used directly by an end user.
Today the web API is the most common meaning of the word: the request travels over the internet, and the response usually comes back in a structured text format such as JSON. A shipping company's API, for instance, can let an online shop order shipping and show current rates without anyone typing in the rate table.
This matters for AI agents because an agent reaches its tools through calls like these. According to one AI company's documentation, as of 2026, a model asks for a tool in a structured call, the developer's code runs it, and a second request sends the result back.
Quiz me
0/3
Recap
An API call is a request in an agreed format, and the API response is the answer.
π‘ A trick to remember it Β· Menu, waiter, kitchen: you order from the menu (the API), the waiter carries the request, and you never see the kitchen.
Surprising fact Β· APIs are not meant for people: they connect software to software.
Sources (3)
No source, no claim. Every fact in this lesson (15 claims) cites at least one of these.