
An API (Application Programming Interface) is a menu a program offers to other programs: “ask me for these things, in this format, and I’ll answer”.
In this article
The restaurant analogy
You (your program) don’t walk into the kitchen (the other company’s database). You give the waiter (the API) an order from the menu (the documentation), and get your dish (the data, usually JSON).
A real request
Many APIs work with a simple web address. For example a currency API might accept:
GET https://api.example.com/latest?base=USD&symbols=INR,EUR
and reply with JSON such as {"base":"USD","rates":{"INR":74.9,"EUR":0.88}}.
Parts you will meet
| Term | Meaning |
|---|---|
| Endpoint | The URL for one kind of request |
| GET / POST | Read data / send data |
| Parameters | Options after ? in the URL |
| API key | Your password for the API — keep it secret |
| Rate limit | How many requests you may make per minute/day |
| Status code | 200 OK, 401 bad key, 404 not found, 429 too many requests |
Into Excel (no code)
Data → From Web, paste the URL, then expand the JSON in Power Query. Refresh gives new data.
Into Python
import requests
r = requests.get("https://api.example.com/latest", params={"base": "USD", "symbols": "INR"}, timeout=30)
r.raise_for_status()
print(r.json()["rates"]["INR"])
⚠️ Never put an API key in a shared workbook or a public GitHub repository. Store it in an environment variable or a separate config file.
✨ Ask AI about this article
Stuck on a step? Ask a question and the AI answers using this article.
Free · AI can be wrong