What is API

What is API

API stands for application programming interface. In other words, an API is set of rules and protocols that allows different software applications to communicate and interact with each other.

EXAMPLE: imagine you are developing a weather application for smartphones. Your application needs to provide up-to-date weather information to it's users.

However, instead of collecting and maintaining all the weather information by yourself you can use a weather API to fetch the necessary information from a weather service provider.

You, as the developer, integrate the weather API into your application.

The API documentation provided by the weather service provider gives you information about how to make requests and retrieve weather data.

When a user opens your weather application and wants to know the current weather in a specific location, they enter the location details (such as a city name) within your application's user interface.

Your application takes the user's input and makes a request to the weather API, specifying the desired location.

The weather API receives the request and understands that you want weather data for a particular location.

The weather API communicates with the weather service provider's database or server, retrieves the weather information for the specified location and packages it in a format that can easily be processed and understood by your application.

Your weather API sends the fetched weather data back to your application in a structured format such as (JSON).

Your application receives the weather data from the API and displays it to the user in a user friendly manner, such as showing the temperature, humidity, and weather conditions for the requested location.

To cut the long story short an API retrieves requested data from servers.