What is an API and Why should I Care?


Hello guys, today I am gonna start my API journey. I have heard lot about API, but never really used it. So today marks the start of a little public journey to document what I learn on API calls.
Whenever someone talks about API, the first example that comes to my mind is the hotel waiter one. APIs are like waiters that serve food from hotel kitchen without making us go to the kitchen.
My agenda :
What is an API?
Types of API
How to call an API, what tools to use?
How to read API docs
Build my own API
Work with real-world APIs
What is an API?
Like I said, it’s our favorite waiter that brings us food without making us go through a huge mess.
When an app needs data, it calls API and API brings data from a service/internal server to the app safely. Sometimes, we might need data from other services. It would be really hard for us to make everything from scratch. Using API helps us to get data that already exists somewhere and to use it easily.
For example, suppose I am working on a website that shows random dog images every time I open it.
Without API, first i need to create a database that actually store the info of all dog breeds and their image. Then I need to create the website for that. But with API calls, I can just create a simple html website and use Javascript built-in browser function fetch() to get a random dog image.
Link: https://ciyarose27.github.io/randomDogGenerator/
Code: https://github.com/Ciyarose27/randomDogGenerator
Another analogy:
Booking a hotel reservation for 3 people is simple — you just call the hotel and ask if a room is available. You don’t need to dig into their internal system to check which rooms are booked, how many staff are working, or how long each reservation lasts. That’s not your job — and frankly, it’s too much information.
APIs work the same way. They let you access the information you need — like whether a reservation is available — without exposing the complex inner workings behind the scenes. It's a simple, secure way to get what you need, without touching what you don't understand or shouldn't access.
Will continue this….
Subscribe to my newsletter
Read articles from cia directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by