An Application Programming Interface (API) allows your services and products to communicate with other products and services. So you can say that an API allows an individual to open up data and create functionality to other developers and businesses and even between departments and locations within your organization. Nowadays this is increasingly becoming the common way by which organizations exchange services, data and complex resources. It is done both externally and internally with partners, and openly with the public.
Use of API
Primarly, an API is launched to provide partners outside the company firewall, access to the comapay's internal resources and data. However, nowadays APIs are being used often by the general public, even the non-developers. Now since APIs' easy-to-use feature and popularity has increased many companies have started using it. APIs demonstrate their value and deliver efficient services which has lead to many companies to consume their own APIs. This is to build websites, internal systems and mobile applications using the same APIs which are made available to third-party developers and even to the general public.
APIs are nothing but a single endpoint for programmatic and easy access to those resource, which can be tailor made and secured to different uses. Previously, an API was originally used to allow integration with distributed systems and websites by various companies. Even now newer companies have quickly realized that a given API would allow new kinds of relationships, thereby making the websites much more social and easy to use.