What is an API?

API stands for Application Programming Interface.

But don’t let the fancy name scare you. Think of an API as a messenger or bridge between two systems. It enables software to communicate with other software.

Real-World Analogy: The Restaurant Example

Imagine you're at a restaurant.

You tell the waiter (API) what food you want (a request).

The waiter takes your order to the kitchen (server), gets your food, and brings it back (response).

You don’t need to know how the kitchen works, you just interact with the waiter.

That’s exactly how APIs work in the digital world.

A Tech Example

Let’s say you’re building a weather app.

Instead of collecting weather data yourself, you use an API like OpenWeatherMap to request current temperatures, forecasts, and other data.

You make a request like this.

GET https://api.openweathermap.org/data/2.5/weather?q=Delhi&appid=yourAPIkey

And the API sends back something like that.

{
  "weather": [
    {
      "main": "Clouds",
      "description": "scattered clouds"
    }
  ],
  "main": {
    "temp": 308.15
  },
  "name": "Delhi"
}

You then display the info in your app.

🔗 Types of APIs

Type Description Example
Open APIs Publicly available Weather APIs, News APIs
Internal APIs Used inside a company Internal HR data
Partner APIs Shared with business partners Amazon seller APIs
Composite APIs Combine multiple services Travel booking APIs

REST vs SOAP (and Others)

You’ll often hear about REST APIs these are the most popular.

If you're starting out, REST APIs are the focus.

How to Use an API (Step-by-Step)?

  1. Find a public API
  2. Get an API key (if required).
  3. Make a request using fetch (in JavaScript).
    fetch("https://api.example.com/data?apikey=yourKey")
        .then(res => res.json())
        .then(data => console.log(data))
        .catch(err => console.error(err));
    
  4. Use the response data in your app.

Tools You’ll Need

Why Should You Learn APIs?

Cool APIs to Try

About the Author

Mohammed Altaf is a CSE student passionate about full-stack development and teaching tech in the simplest way possible. When he's not coding, you’ll find him testing APIs, exploring backend logic, or building MERN stack apps.

Author's Copyright Statement

I, Mohammed Altaf, declare that this article is my original creation. All content, examples, and illustrations are personally written or designed by me and not copied from any source.