The concept
API (application programming interface): a set of rules for how one program asks another for data or action.
JSON: the plain-text format most APIs answer in, made of keys and values (Day 26).
The restaurant version:
- Menu = the API docs: what you can order and how.
- Waiter = the API: takes your order, brings back the dish.
- Kitchen = the server: does the work you never see.
Walkthrough: one request, one response
A request has four parts:
- URL: the address, e.g. https://api.frankfurter.dev/v2/rate/usd/eur
- Method: GET to read, POST to send or create.
- Headers: extra info like "I want JSON" or your API key.
- Body: the data you send (used with POST; GET usually has none).
The response has two:
- Status code: 200 = OK, 404 = not found, 401 = you're not authorized.
- Body: the JSON.
Here is a real response from that free currency-rate API (your numbers will differ):
{"date":"2026-10-15","base":"USD","quote":"EUR","rate":0.89291}
Reading it:
- 4 keys: date, base, quote, rate.
- Text values sit in quotes; the number doesn't.
- Meaning: on that date, 1 US dollar = about 0.89 euros.
Bigger APIs nest objects {} and lists [], but you read them the same way, key by key.
Why this matters for AI: calling a language model is an API call. You POST JSON with the model name and your messages, your key goes in a header, and the answer comes back as JSON. Tool use (Day 37) is the model asking your app to call APIs like this one.
Where you see it at work
- Banking: exchange rates, payment status and account data flow through APIs.
- Insurance: claims portals pull policy and vehicle details by API.
- Healthcare: the FHIR standard exchanges patient records, often as JSON.
- Retail: inventory, pricing and order tracking.
- Business analysis: API field mappings are requirements, written in JSON terms.
Try it today (10โ15 min)
1. Open https://api.frankfurter.dev/v2/rate/usd/eur in your browser. No key, no sign-up.
2. Name each key and value out loud.
3. Change eur to gbp, then to jpy or inr.
4. Change it to xyz. You get an error instead of a rate: a client error, the 4xx family.
5. See the rest of the menu: https://frankfurter.dev
These are reference rates for learning, not for real transactions.
In one sentence
An API is a waiter between programs: you send a request to a URL with a method, and get back a status code and a JSON body you can read key by key.
