What exactly is an api?

What exactly is an api?

# frontend# backend# fullstack
What exactly is an api?Belam Muia

APIs: The Silent Heroes of the Internet API is a term every developer whether beginner or...

APIs: The Silent Heroes of the Internet

API is a term every developer whether beginner or experienced has probably heard before. And honestly? Without APIs, the digital economy would collapse and send us back to “traditional ways.”

Think about it.

When you log into an application, stream a movie on Netflix, or text/call your loved ones on WhatsApp, APIs are working behind the scenes to make all of that possible. Without them, most modern digital experiences simply wouldn’t exist.

So… what exactly is an API?

What is an API?

Imagine visiting a restaurant.

You don’t walk straight into the kitchen and start telling the chef what food you want. Instead, you sit at your table, place your order through a waiter, and the waiter relays the message to the chef. Once the food is ready, the waiter brings it back to you.

That waiter is basically what an API does.

An API (Application Programming Interface) acts as the middleman between the client and the server. Every request passes through the API. The client sends a request, the API communicates with the server, and then returns the correct response back to the client.

Simple, but powerful.

A Simple API Example

https://yoursitebackend.com
Enter fullscreen mode Exit fullscreen mode

Take the URL above.

Imagine you’re building an e-commerce website. A frontend alone isn’t enough if real users are going to use your platform. You’ll need a backend to handle business logic such as:

  • Price calculations
  • Tax additions
  • User authentication
  • Inventory management
  • Payments

Now let’s say a user wants to make a purchase.

Your frontend will send a request to the backend saying something like:

“User A is making a purchase. Please calculate the total price for these items.”

The backend processes the request and sends back a response.

That entire communication process is an API call.

Characteristics of an API

1. Abstraction

If you’ve done Object-Oriented Programming before, this term probably sounds familiar.

APIs hide internal server logic and only expose what the client should see. For example, users don’t need to see raw database errors or sensitive backend processes.

Imagine getting this on your screen:

Database connection failed at port 3306
Enter fullscreen mode Exit fullscreen mode

Yeah… not exactly user-friendly 😭

APIs help prevent that by abstracting the complexity away from users.

2. Standardization

APIs follow specific structures or schemas. You can’t just format data however you want.

One of the most common standards used today is JSON.

Example:

{
  "username": "pookiepotato",
  "role": "developer"
}
Enter fullscreen mode Exit fullscreen mode

This standardization makes communication between systems predictable and easier to manage.

3. Endpoints

Communication in APIs happens through specific URLs called endpoints.

Endpoints are basically locations where resources can be accessed.

Example:

https://yoursitebackend.com/users
https://yoursitebackend.com/products
https://yoursitebackend.com/orders
Enter fullscreen mode Exit fullscreen mode

Each endpoint usually serves a different purpose.


API Architectures

An architecture is like a blueprint for how an API is designed and communicates.

Some common API architectures include:

  1. REST APIs
  2. SOAP APIs
  3. GraphQL APIs

There are many others too, but these are among the most popular.

API Types

1. Public APIs

These APIs are accessible to the public with fewer restrictions. Most of the time, all you need is an API key to start using them.

A good example is the Google Maps API.

2. Private APIs

These are used internally within organizations and are not exposed publicly.

3. Partner APIs

These APIs are shared between specific businesses or partners under controlled access.

4. Composite APIs

Composite APIs combine multiple API requests into a single request, making systems more efficient.


There’s honestly so much more to APIs than just the name, and that’s what makes them exciting to learn.

I’m still exploring APIs myself, and I’ll definitely be sharing more about them in upcoming blogs 🚀