APIs are everywhere. Every app you use talks to other services through APIs. And yet most explanations make it more complicated than it needs to be.
Let me give you the clearest version I know.
The One Analogy That Works
An API is a waiter.
You're at a restaurant. You don't go into the kitchen. You don't cook the food yourself. You tell the waiter what you want, the waiter goes to the kitchen, the kitchen prepares it, and the waiter brings it back to you.
You never interact with the kitchen directly. The waiter is the interface.
In software:
- You're the app (or the developer making the request)
- The waiter is the API
- The kitchen is the server/database with the data
- The food is the response
That's it. That's what an API is.
What Actually Happens When You Use One
Say you're using a weather app. You type in your city and see the current temperature.
Behind the scenes:
- The app sends a request to a weather API: "Give me the current temperature for Melbourne"
- The API server receives that request
- The server looks up the data (from weather sensors, satellites, whatever)
- The server sends back a response:
{"city": "Melbourne", "temperature": 22, "unit": "celsius"} - Your app reads that response and shows you "22°C"
The whole thing happens in milliseconds. You see a number. The app made an API call.
REST — The Standard
Most APIs you'll encounter are REST APIs (REpresentational State Transfer). REST isn't a technology — it's a set of conventions about how requests and responses should work.
The key ideas:
Resources — Everything is a resource with a URL. A user is /users/123. A list of products is /products. A specific order is /orders/456.
HTTP Methods — Different operations use different methods:
-
GET— Read data -
POST— Create something new -
PUT/PATCH— Update something -
DELETE— Remove something
Status Codes — Responses include a number telling you what happened:
-
200— Success -
201— Created -
400— Your request is wrong -
401— Not authenticated -
404— Not found -
500— Server error
JSON — Data travels in JSON format (key-value pairs, like a dictionary). Easy for both humans and machines to read.
A Real Example
Say you're building an app that shows GitHub repos. You'd call:
GET https://api.github.com/users/tysoncung/repos
GitHub's API receives that request, finds the repos for that user, and sends back a JSON array with all the details. Your app loops through that array and displays them.
You didn't need access to GitHub's database. You didn't need to know how their servers work. You just followed their API documentation and made a request.
Why APIs Matter
For developers: APIs let you build on top of existing services instead of reinventing everything. Need payments? Stripe API. Need maps? Google Maps API. Need user authentication? Auth0 API. Your app becomes a composition of specialized services.
For companies: APIs are how products become platforms. Twitter opened their API and an entire ecosystem of clients and tools emerged. Stripe's API is why developers love them — it's clean, well-documented, and predictable.
For you as a learner: Once you understand APIs, a massive part of modern software development clicks. Every mobile app, most web apps, and increasingly even desktop apps are built around API calls.
What You Should Learn Next
If you want to go deeper:
- Authentication — How do APIs know you're allowed to make requests? (API keys, OAuth, JWT)
- Rate limiting — Why APIs restrict how many calls you can make
- Webhooks — The reverse of an API call: the server pushes data to you instead of you pulling it
- API documentation — How to read and use API docs (Swagger/OpenAPI)
But for 80% of what you'll do as a developer, the waiter analogy is all you need to hold in your head. Request, response, JSON, HTTP methods. The rest is details.
What was the first API you integrated? What made it click for you?
Top comments (0)