DEV Community

Kpeale Legbara
Kpeale Legbara

Posted on

Understanding APIs: Basics, Types, and Architectures Explained Simply

Human beings are not the only ones who have communication. Do you know that websites also talk to each other? Yes, they communicate with each other through an API.

What is API?

API is an acronym that stands for Application Programming Interface. API is a set of rules that allow software applications to communicate to each other. APIs are used in our everyday life even without us knowing. Most of our applications on our phones utilize APIs, from the smallest app to the largest app.

Simple Analogy Of How Websites Talk:

When you walk into a restaurant, whether a fine dining or a casual dining . You are greeted by the waiter and handed the menu. You never get to speak to the chef yourself. All communications are handled by the chef till you are served your food.

Waiter serving food in a restaurant

In the same way, when two applications are talking to themselves they do it through a third person, which is the API.
Every single Application we use, makes use of API. From the weather forecast application to the movies applications on your phone. They are communicating to a server through the API which makes information available to be used on these platforms.

What API allows us to do?

APIs allow us to do so many things without even realizing it. When you open your weather app and it shows you the current temperature in your location, that’s an API working behind the scenes. When you book a ride with Bolt or order food with Jumia Food, APIs are involved in fetching real-time prices, delivery times, and more. That is when your data is turned off, you cannot use the services of these applications.

As frontend developers, APIs allow us to request data from a backend server and display it beautifully on the frontend. As technical writers, understanding what APIs can do helps us explain how different parts of a system talk to each other, and how users can integrate or use those features.

How Do APIs Work?

Let’s break it down with a real-world perspective.

When you open your favorite e-commerce website and search for “wireless headphones,” here's what happens behind the scenes:

  • Your search query is sent to the server via an API.
  • The API receives your request, processes it, and sends it to the right place in the backend system.
  • The backend retrieves a list of products, wraps that data, and sends it back via the API.
  • Your browser then receives that data and displays the results on the screen.

So essentially, the API acts as a messenger between your frontend and backend.

Common API Request Methods

  • GET – to retrieve data (e.g., get a list of blog posts)
  • POST – to send new data (e.g., create a new user)
  • PUT – to update existing data
  • DELETE – to remove data

These methods follow the HTTP protocol, which is the same language your browser uses to access web pages.

Types of APIs

APIs come in different flavors depending on how they’re used and who has access to them:

A. Open/Public APIs
These are available to anyone. Companies like Twitter, GitHub, and Spotify offer public APIs so developers can build apps that interact with their platforms.

Example: You can build an app that fetches tweets based on a hashtag using the Twitter API.

B. Private APIs
Used internally within a company. These APIs are not exposed to the public and are used to connect different internal services.

Example: A bank might use private APIs to connect its mobile app to the database that holds user account info.

C. Partner APIs
These are shared with specific business partners. They're not public, but they're not completely private either — they're accessible to selected users who have been granted permission.

Example: An airline might offer a partner API to travel agencies to book tickets directly.

D. Composite APIs
These combine multiple APIs into one call. Instead of sending multiple requests, a composite API allows you to bundle them.

Example: A dashboard that shows user details, recent orders, and notifications might use a composite API to get all that info in one go.

API Architectures

Different APIs are designed using different architectures. The most common ones include:

A. REST (Representational State Transfer)
REST is the most popular architecture. It’s simple, stateless, and works well with HTTP methods like GET and POST. It uses URLs to identify resources. Data is usually exchanged in JSON format. It’s stateless, meaning each request stands alone.

Example: GET https://api.example.com/users/123 fetches data about user 123.

B. SOAP (Simple Object Access Protocol)
SOAP is older and more strict. It uses XML instead of JSON and has strict messaging rules. More secure than REST in some cases. Still used in industries like banking and government. Think of SOAP as the “corporate” version of REST — formal and detailed.

C. GraphQL
GraphQL is newer and more flexible. Instead of getting too much or too little data, you can request exactly what you need. Created by Facebook. It reduces over-fetching or under-fetching of data. It uses a single endpoint for all queries

Example: You can ask for a user’s name and email in one query — and that’s all you’ll get back.

Tools That Help You Work with APIs

Learning about APIs is one thing, but knowing how to work with them is where the fun begins. Here are some tools you'll come across often:

  • Postman: This is your best friend for testing and exploring APIs. You can send different kinds of requests, view responses, and even write simple tests.
  • Swagger / OpenAPI: These help developers document APIs properly. They create readable, interactive docs based on your API’s code.
  • Curl: A command-line tool for sending HTTP requests. Useful for quick testing if you're comfortable with the terminal.

Conclusion

APIs are the invisible glue holding the internet together. They make our apps smarter, our websites more dynamic, and our digital experiences smoother. Whether you're a developer building interfaces or a technical writer documenting how things work, understanding APIs is no longer optional — it’s essential.

So the next time you open your favorite app and it “magically” shows you new data, just know: it’s not magic. It’s an API, doing its job in the background.

Top comments (0)