← Back to journal What Is an API? A Simple Guide to Apps Talking to Apps

What Is an API? A Simple Guide to Apps Talking to Apps

Understand APIs as a clear way for one piece of software to ask another for information or an action.

A menu between systems

Suppose you are at a restaurant. You do not walk into the kitchen and search the cupboards yourself. You choose from a menu, tell the waiter what you want, and get a dish back. An API plays a similar role for software: it describes what one program can ask another program to do.

A weather app might ask a weather service for the forecast. A portfolio contact form might ask its server to save a project inquiry. The app making the request does not need to know how the other system stores or prepares the information.

App asks→API receives→Service replies

Request in, response out

A web API commonly uses HTTP, the same basic protocol browsers use to load websites. A request has a method, an address, and sometimes data. The method explains the kind of action: GET usually reads something, while POST usually sends new information.

For example, a browser can ask for a list of projects:

async function loadProjects() {
  const response = await fetch("/api/projects");
  const projects = await response.json();
  console.log(projects);
}

loadProjects();

The server sends a response. It often contains JSON, a text format that looks like JavaScript objects but is understood by many languages. The response also has a status code: 200 means it worked, 404 means the requested thing was not found, and 500 means something failed on the server.

Where the backend fits

The API is the agreed doorway. The backend is the software behind that doorway. It checks the request, decides whether the person is allowed to do it, talks to a database or another service, then sends back a result.

That separation matters for safety. A browser is controlled by the person using it, so private passwords and secret service keys should never be placed in front-end JavaScript. Keep secrets on a server and let the browser talk to your server instead.

APIs are useful because each side can change internally while keeping the same agreement. If the menu still offers “show my projects,” the app does not need to know whether those projects now come from a new database.

Try it yourself

Open your browser’s developer tools, choose the Network tab, and reload a page. You will see requests for HTML, images, fonts, and sometimes API data. Click one and inspect its address, status, and response. It is a practical way to watch apps talk.