API

Jun 2, 2025

#

What is API

An application programming interface (API) defines the rules for how two program communicate with each other. It's usually used in client–server model.

API is like a gateway between client and server. API diagram

#

Resource

Resources are the data that software provides to their clients. It can be number, text, image, binary, or any type of data.

#

Client

Clients are the role who want to access resources from the server, and thus they need to send a request following API provided by the server.

#

Server

On the server, there are multiple resources that the client aims to access. Upon receiving a request, the server places the requested resource into the response and sends it back. In fact, the API is defined on the server side.

#

An example of HTTP API

[GET] https://www.google.com/
request

The resource in the response is HTML file.

<html>
<head>...</head>
<body>...</body>
</html>
HTML
#

When did API propose

API originated in the 1940s, but the terminology didn't come into play until the 1960s and 1970s.

#

Reference