Web

APIs

An API (Application Programming Interface) is a way for programs to talk to each other. On the web, that usually means sending HTTP requests and getting structured data back.

Endpoints

Each URL an API exposes is an endpoint. You send a request and get a response.

GET https://api.example.com/users/42

JSON

Most web APIs return JSON — a simple text format for structured data.

{
  "id": 42,
  "name": "Ada",
  "active": true
}

Making a request

const res = await fetch("https://api.example.com/users/42");
const user = await res.json();
console.log(user.name);