Sunday, 6 December 2026 About Contact Write for Us Advertise Privacy
Education

APIs Explained: How Apps Talk to Each Other

An API is a set of rules that lets one program ask another for data or actions. Learn requests, responses, status codes and API keys with a worked example.

Intermediate

When a weather widget shows today’s forecast or a shop accepts a card payment, one program is asking another to do something. The rules for that conversation are called an API, short for application programming interface.

The restaurant analogy

You (the client) do not walk into the kitchen. You tell a waiter (the API) what you want, and the waiter brings back the result. The API defines what you can ask for and how the answer will look, while hiding how the kitchen works.

Requests and responses

Most web APIs use HTTP, the same protocol as web pages. A client sends a request and gets a response.

  • URL (endpoint): where to ask, for example /api/articles/42.
  • Method: what to do. GET reads data, POST creates it, PUT or PATCH changes it, DELETE removes it.
  • Headers: extra information, such as the data format or your credentials.
  • Body: data you send, usually in JSON.

A worked example

A request to read one article:

GET /api/articles/42
Accept: application/json

A typical response:

200 OK
{
  "id": 42,
  "title": "APIs Explained",
  "author": "Abhira Media"
}

JSON in one minute

JSON is a text format made of names and values inside curly braces. It is easy for people to read and for programs to parse, which is why most APIs use it.

Status codes

  • 200 OK: it worked.
  • 201 Created: a new item was made.
  • 400 Bad request: the request was malformed.
  • 401 / 403: you are not signed in, or not allowed.
  • 404 Not found: no such item.
  • 429 Too many requests: you hit a rate limit.
  • 500 Server error: the problem is on the provider’s side.

API keys and authentication

Many APIs ask you to prove who you are with an API key or a token. Treat these like passwords: never put them in public code or in a web page that anyone can view.

REST in short

REST is a common style that treats everything as a resource with its own URL and uses the standard HTTP methods on it. Other styles exist, such as GraphQL, where the client describes exactly which fields it wants.

Good habits when using an API

  1. Read the provider’s documentation and limits first.
  2. Handle errors and timeouts instead of assuming success.
  3. Cache results that do not change often.
  4. Keep keys in environment variables or a secrets manager.

Key takeaways

An API is a contract: send a correctly formed request and you get a predictable response. Learning to read a request, a response and a status code is enough to understand most integrations.

Watch more on this topic

Big Buck Bunny

A short animated film, included here as a sample video.

Sintel Trailer

A trailer from the animated film Sintel, included here as a sample video.

HTML Video Sample

A short sample clip to demonstrate the homepage video player.

Leave a Reply

Your email address will not be published. Required fields are marked *

Press Enter for full results · Ctrl/⌘ + K to open anywhere