API, three letters often encountered on the web, whose meaning might not be immediately clear. An API, or application programming interface, allows two applications to communicate with each other. Let's explore how and why the concept of an API is gaining so much traction in the world of web development.
API, did you say API?
An API makes the data or functionalities of an existing application available so that other applications can use them. This should clarify the concept of an application programming interface.
Using an API allows you to leverage an existing program rather than redeveloping it, resulting in significant time savings.
What an API can do concretely
The first thing an API does is expose, meaning it makes functionalities or data available. To use them, most APIs require a key (API key), sometimes even two. This key allows the API to identify you as a user with the necessary rights to use the API.
This issue of authentication is crucial when discussing APIs. Let's take a concrete example: at Debord agency, when a contact form is submitted, it sends the contact data to our client space. We designed this client space with an API to allow other applications (our website, in this case) to record data there. What would happen if this recording wasn't subject to security rules? Well, anyone could record anything in our client space. In our case, each data submission via the client space API requires authentication. This ensures that the information to be recorded indeed comes from our website and not elsewhere.
Need a fast and robust API?
We develop reliable and scalable REST APIs designed to support the continuous transformation of your business needs.

Exposing Data
One of the main features found when using an API is data exposure. This means that the content of a site (pages, articles) is accessible through endpoints, in a structured data format. Specifically, by going to a certain URL, you will have the site's data in **JSON** format. Many sites do this natively, sometimes without you even knowing.
What does it look like? Here is an example of the API offered by the site data.gouv.fr

While this may seem intimidating for the non-technician, this page allows you to retrieve the listed data in a standardized format and display it anywhere else.
You can then imagine a site exposing information, which will be retrieved from one or more sites.
A concrete example? Imagine Mrs. Durand who has 5 real estate agencies with 5 different websites. She can supply each of her 5 sites with a single API that groups all her listings. Each site will then fetch the appropriate listings according to the postal code. Thus, Mrs. Durand no longer has to update 5 sites but only her single listings back-office. Convenient, isn't it?
Exposing Services

In addition to exposing data, an API can also expose services and features. Imagine you want to send a mass email; in this case, instead of renting and configuring a mail server, you can use the API of a service like Sendgrid. Specifically, when a form is submitted from this site, an email is sent to me using the Sendgrid API. Sendgrid provides guarantees on the deliverability of my email and statistics regarding its reception. This allows for a highly efficient service at a very low cost, as Sendgrid even offers the sending of 40,000 emails for free!
Another example: when you have a form on a site with an address field. Sometimes, by typing the address or postal code, the form suggests a preformatted address. For this, you can use the Google Places API.
Different Types of APIs
An API can be accessible to everyone without authentication, which is known as a public API. This is notably the case for the geographic APIs of the French government. For example, the API of geo.api.gouv.fr allows public access to information about French communes simply by visiting a URL:
curl 'https://geo.api.gouv.fr/communes?codePostal=78000'
However, an API may require authentication, using a key or an authentication token (JSON Web Token). In this case, it is referred to as a private API.
Finally, APIs can be distinguished by their approaches:
- SOAP APIs (Simple Object Access Protocol): this approach is increasingly less used,
- REST APIs (Representational State Transfer): this is the most commonly used architecture today,
- GraphQL APIs, this new API architecture style developed by Facebook offers an alternative to REST
New Ways to Design an Application
Finally, using an API allows you to design your site or application in a more modern and less monolithic way. This results in performance gains and offers greater possibilities for evolution. On this topic, read our previous article dedicated to decoupling a website, which contains a wealth of information on this point.
New Business Opportunities
Finally, the widespread use of APIs also represents new opportunities. Today, companies are being created with an offering that consists of providing an API. The client then pays a subscription to access and use this API. In your own sector, you can think of an API exposing data or functionalities that could be reused by businesses in your field. Thus, your competitors today could become your clients tomorrow.
Any data or functionality can potentially be transformed into an API, you just need to imagine them!

