On this page
Every time a weather app shows your city's temperature, or a payment app checks that money reached a shop, one program is asking another for something. The agreed way of asking is called an API. Here it is in simple words, with your school canteen and one real request you can try.
What is an API in simple words?
An API (application programming interface) is a set of features and rules inside a program that lets other software interact with it, as opposed to a screen a person uses, according to MDN Web Docs. MDN also calls an API "a simple contract" between the application offering it and the software using it.
Think of the canteen. You never walk into the kitchen to cook your own dosa. You read the menu board, order at the counter in the way it expects, and get back a plate or "sorry, it's finished". The kitchen can change cooks and stoves without you noticing, as long as the counter works the same way. An app likewise does not need to know how another system works inside. It only needs the menu and the rules for ordering.
How does a canteen counter map onto an API?
Menu board: the API documentation, listing what you may ask for and how.
Your order ("one masala dosa, no onion"): the request, with its details, called parameters.
Your ID card: an API key, which tells the service who is asking. Open-Meteo, for example, gives an API key with a paid subscription (Open-Meteo pricing).
The kitchen: the server, doing the work out of sight.
The plate, or "not available": the response.
"Stop coming back every minute": a rate limit. MDN lists status 429, Too Many Requests, for a user who "has sent too many requests in a given amount of time" (MDN status codes).
What are a request and a response?
On the web, the messages a client sends are called requests and the server's answers are called responses (MDN: Overview of HTTP).
Every response carries a three-digit status code whose first digit defines the class of response, according to the HTTP standard RFC 9110, published in June 2022. MDN groups the codes into five classes (MDN status codes); three matter most:
2xx, success: 200 OK means the request succeeded. The plate is on the counter.
4xx, client error: 400 Bad Request, 401 (identify yourself first), 404 Not Found, 429 Too Many Requests. Your order was the problem.
5xx, server error: 500 means the server hit a situation it did not know how to handle. The kitchen was the problem.
How do you call a real API? A worked example
Open-Meteo runs a weather API you can call from a browser; its pricing page says the free API is for non-commercial use and rate-limited to 10,000 calls a day. Paste this into the address bar:
https://api.open-meteo.com/v1/forecast?latitude=28.61&longitude=77.21¤t=temperature_2m
Read it like a canteen order:
api.open-meteo.com is the counter.
/v1/forecast is the menu item.
After the ? come the details: the latitude and longitude of New Delhi, and current=temperature_2m, asking for the temperature right now.
When we sent it on 11 November 2026 (reading time 10:30 GMT), the response came back as JSON text that included "temperature_2m":27.2 with the unit "°C". Your number will differ, because the weather changes. The coordinates returned were slightly different because, as the Open-Meteo docs explain, the reply gives the centre of the weather grid cell it used.
Now change latitude to 999 and send it again. We got status 400 and the message "Latitude must be in range of -90 to 90°. Given: 999.0." The counter rejected the order and said why.
How do apps and AI tools talk to each other?
Most apps are a screen in front of many counters. A UPI payment passes from system to system (how UPI works, step by step), and loading a website is itself a chain of requests and responses (what happens when you type a website address).
AI chat tools work the same way. Anthropic's documentation says a program sends a structured list of input messages to POST /v1/messages, and the model generates the next message in the conversation (Claude Messages API docs). So a homework app built on an AI model may be a screen plus a request to another company's counter, answered by computers in a data centre where AI answers come from. Think before pasting anything personal into one.
A ten-minute check that you have understood
For a food delivery app, name the menu, the order, the kitchen and the plate.
Run the Open-Meteo request with your own city's latitude and longitude.
Break it on purpose and read the 400 message.
Explain an API to a parent in two sentences, without the word "interface".
If words like client, server or protocol still feel shaky, the Fermi Concept Library has a lesson for every concept in physics, chemistry, biology, mathematics and computing, each with its place in the map.
Next time an app loads, picture the counter.



