APIs and JSON Basics

How different programs talk to each other, and the format they usually use to send each other data.

Last updated: September 23, 2026

Basic term

What is an API

API

Short for Application Programming Interface, a defined interface through which two programs can exchange data, without either one needing to know how the other is built internally.

Everyday example

A weather app asks a weather service's API for the current values for a location, instead of running its own weather stations.

Web API

An API reachable over the internet via HTTP, by far the most common kind of API today.

What requests look like

HTTP methods

Determine what should happen to the data on the server.

The most important methods

GETRequests data, doesn't change anything on the server
POSTSends new data to the server, for example creating a new account
PUTReplaces existing data entirely
DELETEDeletes data on the server

Matching status codes

After every request, the server responds with a status code like 200 or 404. A full overview is on the dedicated status codes page.

The most common format

JSON

JavaScript Object Notation, a simple text format most APIs use today to send their data.

Basic building blocks

{ }Curly braces wrap an object, a collection of named values
[ ]Square brackets wrap a list of several values
"key": "value"A named value, keys and text sit in quotation marks
"number": 5Numbers are written without quotation marks

Example

{ "name": "Max", "age": 20, "city": "Berlin" }A simple JSON object with three values