I know many people, both in technology and in other places, who have a rather vague or false idea about what this fairly common term means.
Technical API for the application programming interface. At one point, most major companies have created APIs for their clients or for internal use.
But how do you explain your API in simple English? And is there a broader meaning than that used in development and business? Let’s go back and see how the web works in itself.
WWW and external servers—
If I think of the web, I suggest a large network of connected servers.
Every page on the web is stored somewhere on an external server. An external server is not so mysterious: it is only part of a remote computer that has been optimized to process the requests.
To put things in the right perspective, you can run a server on your laptop that can serve an entire website on the web (in fact, a local server is what engineers use to develop websites before they are published. ).
When you enter www.facebook.com in your browser, a request will be sent to the external Facebook server. As soon as your browser receives the response, interpret the code and display the page.
For the browser, also known as the client, the Facebook server is an API. This means that each time you visit a web page, it communicates with the server’s remote remote API.
APIs as a way to serve your customers–
You’ve probably heard of companies that package APIs as products. For example, Weather Underground sells access to the API for weather data.
Sample scenario: your small business website has a form that allows customers to subscribe to events. You want to offer your customers the opportunity to automatically create a Google Calendar event with the details for that event.
Use of API: the idea is that the server of your website communicates directly with the Google server requesting an event with the specified details. Then, your server receives the response from Google, processes it and sends relevant information to the browser, as a confirmation message for the user.
Alternatively, your browser can often send an API request directly to the Google server without ignoring your server.
How does this API differ from another external server?
In technical terms, the difference is the format of the request and the response.
To see the entire web page, your browser expects an HTML response containing a presentation code, while the call to the Google Calendar API only returns the data, probably in a format like JSON.
If the server of your website makes the API request, the server of your website is the client (similar to the fact that your browser is the client when you use it to navigate to a website).
From the perspective of the users, the APIs can execute the action without leaving your website.
Most modern websites use at least some third-party APIs.
Many problems already have a third-party solution, either in the form of a library or service. It is often easier and more reliable to use an existing solution.
It is not uncommon for development teams to split their application into different servers that communicate with each other via the API. The servers that perform auxiliary functions for the main application server are commonly referred to as micro services.
In summary, when a company offers an API to its customers, it simply means that they have created a set of special URLs that return pure data responses, which means that the answers will not contain the type of overhead delivery they would expect in a graphical user interface. of the user as a website.
Can you make these requests with your browser? Often, yes. Since the actual HTTP transmission occurs in the text, your browser will always make every effort to show the answer.
A is for “Application”
Let’s see a few more examples of API to close.
The “application” can relate to many things. These are some of them in the API context:
- A piece of software with a different function.
The complete server, the entire application or only a small part of an application.
In short, any piece of software that clearly distinguishes itself from its environment can be an “A” in API and probably also has a kind of API.
Suppose you use a third-party library in your code. Once included in your code, a library becomes part of your general application. Because it is another piece of software, the library is probably provided with an API that allows it to communicate with the rest of the code.
Here’s another example: in Object Oriented Design, the code is organized into objects. Your application can contain hundreds of defined objects that can communicate with each other.
Each object has an API: a set of methods and public properties that it uses to communicate with other objects in the application.
An object may also have an internal logic that is private, which means that it is hidden for the external scope (and not for an API).
From what we discussed, I hope it eliminates the broader meaning of API, as well as the most common uses of the term today.