Ever wondered how your weather app knows it's raining outside? Or how a food delivery app shows live restaurant menus?
That's an API doing its job. Let's break it down — the easy way.
Think of a restaurant.
You (Customer) → Waiter → Kitchen → Waiter → You (Food!)
An API (Application Programming Interface) is the waiter.
It takes your request, delivers it to the system that has the answer, and brings the response back to you — without you needing to know how the kitchen actually works.
[Client/App] → sends Request → [API] → talks to → [Server/Database]
|
[Client/App] ← sends Response ← [API] ← ----------- ↓
Step by step:
That's it. That's literally how Instagram loads your feed.
REST is just a set of rules for how APIs should be designed.
Most APIs you'll use today (weather, payments, maps, chatbots) follow REST.
🧠 Easy way to remember: REST APIs treat everything like an address (URL) you can visit to get specific data.
https://api.weather.com/city/mumbai
This URL is called an endpoint — a specific door into the API.
These are the "verbs" — they tell the API what action you want.
| Method | Action | Real-Life Example |
|---|---|---|
| GET | Read data | Viewing a profile |
| POST | Create data | Signing up for an account |
| PUT | Update data | Editing your profile |
| DELETE | Remove data | Deleting a post |
Here's a simple GET request example:
GET https://api.example.com/users/101
Response:
{
"id": 101,
"name": "Juned",
"email": "juned@example.com"
}
You "ask" for user 101 → the API "replies" with their data.
Every API response comes with a status code — think of it as a quick health report.
| Code | Meaning | Simple Explanation |
|---|---|---|
| 200 | OK | ✅ Everything worked |
| 201 | Created | ✅ New data was added |
| 400 | Bad Request | ❌ You sent something wrong |
| 401 | Unauthorized | 🔒 You need to log in / send a key |
| 404 | Not Found | ❓ That endpoint doesn't exist |
| 500 | Server Error | 🔥 Something broke on their end |
Most APIs ask for an API key — think of it as your ID card.
Request → [Your API Key Attached] → API Checks ID → Allows/Denies Access
This helps the API: - Know who's calling - Track usage limits - Block random/unauthorized access
Basically — if two apps are "talking" to each other, there's an API involved.
🔌 API = A messenger between two systems
🍽️ Analogy = Waiter taking your order to the kitchen
🔄 Flow = Request → API → Server → Response
🛠️ Methods = GET, POST, PUT, DELETE
🚦 Status Codes = Tell you if it worked or failed
🔑 API Key = Your ID card for access
APIs are EVERYWHERE — once you understand them,
you start seeing how the entire internet connects! 🌐
👉 Up next: GET vs POST Request — What is the Difference and When to Use Each. Now that you know what an API actually is, you'll see exactly how these two methods are used to talk to one.
TechWithJuned · Learn → Execute → Build