<aside> 💡

Your app looks great. But the data is fake. Where does real data come from?

</aside>


1. What is an API

Your app needs data it doesn't own. Weather, maps, payments, user posts. That data lives on someone else's server. The API is the door between your app and that server.

🧑‍💻 The Restaurant

Restaurant Code
You (customer) Your App
The waiter The API
The kitchen The Server
The menu The Documentation
Your order The Request
The food The Response

You never enter the kitchen. Your app never touches the database. The API carries everything back and forth.

The Pattern

Every API call follows this shape:

image.png

You ask. It answers. That's it.

📌 Summary

Term Meaning
API The door between your app and a server
Request What you send (URL + method)
Response What comes back (status code + data)
Server Someone else's computer with the data you need

2. JSON

The format your app and the server agree on. Keys and values.

🧑‍💻 Example

{
  "id": 1,
  "dish": "Suqaar",
  "price": 8
}

Rules:

  1. Keys are always strings in double quotes