The Basics of API

An API (Application Programming Interface) is an interface that allows the interaction of software systems. It is just like the user interface we see in our day-to-day life. Just a catch, the API is an interface not for a human but for a machine or a software application. It helps a developer use some information or feature which is already made available by an API provider to consume in their application.

Let us take an example. You may have come across music streaming platforms. You click the play button on the application and it starts playing the music (Don't Click). You did not know how the play button started playing your particular music. All you did was press a button. You are abstracted from the code of how it worked.

Now think of what the developer did. He must have added an event listener to the button and attached the particular audio file. He didn’t write the code for how the click listener performs. Imagine the amount of work developers would have to do if the event listener was not available to them. Briefly, they make our life easy.

Providers and Consumers

An API broadly has two personalities involved, the provider and the consumer. A provider is a body that provides the API and the consumer consumes the particular API. If we take the example of Google Maps API, Google here is the API provider and developers and users are the API consumers.


Types of APIs

There are broadly three basic types of APIs

Public API

Public APIs are the type of APIs which are available on the web publicly. They are often referred to as open or free APIs. An example can be a Google Maps API.

Partner API

Partner APIs are used for software integration between an organization and its partners.

Private API

Private APIs are used within the organization for communication between different applications and systems.


Why should you use an API?

APIs have a wide range of benefits. The efficiency of an application increases when an API is used for communication. APIs are a great way of monetization. Many organizations monetize their API on the web. APIs are a great way to build your brand. By making your API public, you can attract a lot of traffic to your website. For a developer, APIs are a great way to get functionality done without much hassle. Imagine just fetching some data from a Weather API rather than establishing a system for weather conditions at various locations. The only thing we need to keep in mind is API security.


Terminologies you might hear while exploring APIs

REST API

A REST API, also known as RESTful API is a web API that obeys the rules of REST architectural patterns and it allows interaction with RESTful web services. REST means Representational state transfer.

POSTMAN

POSTMAN is a handy tool for APIs. You can create and use APIs here easily. You can download it on your local system from here

https://www.postman.com/downloads/

cURL

cURL is a command line tool for transferring data in various protocols, in our case HTTP. Many API calls are made using cURL syntax.

Get Started Now

Here are some APIs that you can use to create amazing applications.

Weather API - https://openweathermap.org/api

Google Maps API - https://developers.google.com/maps/apis-by-platform

Spotify API - https://developer.spotify.com/documentation/web-api/

Other Resources :

https://www.programmableweb.com/

https://www.freecodecamp.org/news/apis-for-beginners-full-course/

Image from : https://www.happiestminds.com/wp-content/themes/hmtheme/images/api-services.png