# API (Application Programming Interface)

URL: https://softwaredictionary.org/terms/api
Category: Backend & APIs
Last updated: 2026-09-29

In short: An API is a set of rules that lets one piece of software request data or actions from another in a predictable, documented way.

## What is an API?

An API is a contract: it describes which operations a piece of software offers to others and exactly how to call them. As long as the caller follows those rules, it can use the functionality without knowing anything about how it works inside.

A common analogy is a waiter in a restaurant. You don't walk into the kitchen; you give your order to the waiter, who brings back the result. On the web, the order is usually an HTTP request and the result is usually data in `JSON` format.

APIs are not limited to web services. The functions an operating system exposes for reading files, or the public methods of a library, are APIs too.

## Key takeaways

- An API defines how two pieces of software communicate.
- Callers don't need to know the internal implementation.
- Web APIs usually work over HTTP and return JSON.
- Libraries and operating systems expose APIs too, not just web services.

## Example: Fetching data from a web API

```javascript
// Ask the API for a user's details
const response = await fetch("https://api.example.com/users/42");
const user = await response.json();

console.log(user.name);
```

## Frequently asked questions

**Is an API the same as a REST API?**

No. API is the general concept; a REST API is one style of API built on HTTP that follows REST principles.

**What is an API key?**

An API key is a secret value sent with requests so the API can identify the caller and control or limit access.

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
