blog


What is an API?

API = Application Programming Interface

An API is a set of rules that allows two software systems to talk to each other.

It acts as a bridge or contract between:


Example

Imagine a weather app:

{
  "city": "Bangalore",
  "temp": "28°C",
  "condition": "Cloudy"
}

You never see how weather is calculated—you just get the result.


Why APIs exist?

APIs help systems:

Example:


API Styles List

API Styles
├─ REST
├─ RPC
├─ GraphQL
└─ SOAP

1. REST (Most common)

simple web rules

Example:

GET /weather/bangalore

2. RPC (Remote Procedure Call)

calling a function on another computer


3. GraphQL

ask exactly what you want

Instead of getting fixed data, you request fields:

{
  user {
    name
    email
  }
}

Advantage: no extra/unwanted data


4. SOAP

old, strict, formal system