An API is a doorway between programs. Instead of a person clicking buttons on a screen, one program sends a request in an agreed form, and another program answers in an agreed form. The word interface is the key: it describes what you may ask and what you get back, not how the answer is produced.

The short form stands for Application Programming Interface. It is used for everything from the functions a programming language offers to the web services that companies open to their customers. This entry is about the second kind, the web API.

What a web API looks like

A web API works over the same protocol as websites, HTTP. A program sends a request to an address and gets an answer, most often written as JSON, a plain text format for structured data. The example below is only an illustration of the shape.

GET /api/sites HTTP/1.1
Authorization: Bearer YOUR_KEY

200 OK
{"sites": [{"name": "Shop", "status": "up"}]}

The request names what is wanted (the address and the method) and proves who is asking (the key). The answer carries a status code that says whether it worked. See HTTP status codes for what those numbers mean.

What an API is used for

  • Reading data into another tool, such as a report, a spreadsheet, or a dashboard.
  • Connecting services, so that an event in one service starts an action in another.
  • Automation, where a script does on a schedule what a person would do by hand.
  • Building on a service, where a company makes its own application on top of data it does not store itself.

Read-only and read-write

An API can let you only look, or it can also let you change things. A read-only API can show data but cannot create, edit, or delete anything. If a read-only key leaks, information can leak, but the account cannot be damaged. A read-write API is more powerful and needs more care about who holds the key.

Common misunderstandings

  • "An API is the same as a website." A website is made for people to read. An API is made for programs, and it usually has no pages at all.
  • "A key is the same as a password." A key identifies a program and sets what it may do. It must be kept as secret as a password, but it is usually made for one use, so that it can be revoked without touching anything else.
  • "Every API is REST." REST is one style of web API. Many APIs are called REST while following only some of its rules, and others use different styles.

APIs and monitoring

Monitoring and APIs meet in two places. A monitor can check that an API answers correctly and quickly, because a broken API breaks everything built on top of it. And a monitoring service can offer an API of its own, so that you can read its results in other tools.

UptimeWire has a read-only API on the Business and Agency plans. Your own tools can read the monitoring data of your account through it. It cannot change anything in the account, and its keys are separate from the keys of the MCP connection for AI assistants.