What is an API?
An application program interface (API) is a collection of routines, protocols, and tools for building software applications. It states how software components should interact. Additionally, API is used when programming graphical user interface (GUI) components. An excellent API makes it easier to develop a program by offering required building blocks. A programmer then aligns the blocks together.
Example: Imagine you’re in a restaurant with a tasty selection to order from. The kitchen is the part of the “system” that prepares the order. The waiter- API acts as the messenger; critical link to converse the order to the kitchen. Then the waiter delivers the response back to you; in this case, it is the food.
APIs: A Developer’s Dream Come True
When developing an app for an iPhone, the Apple iOS operating system-like other operating systems- offers a wide portfolio of APIs to ease the task. By using the camera API to embed the built-in iPhone camera in your app you can capture photos or videos easily, without writing your own camera interface.
Without the existence of APIs, developers would have to reinvent over and over again. Do you want to create a dialog box on Windows? There’s an API for that. Want to support fingerprint authentication on Android? There’s an API for that, too, you need not test all the different Android manufacturer’s fingerprint sensor.
Controls Access to Resources
APIs play a major role in terms of security. They are utilized to regulate access to hardware devices and software functions which an app might generally not have permission to use.
Example: Messages that pop up on browsers asking for location uses the geolocation API in your web browser. These APIs are exposed by web browsers to ensure web developers can easily access your location. Your physical location is identified when the browser access GPS or Wi-Fi- networks in close proximity.
As afore mentioned, APIs controls access and thus browsers can freely expose information via and API. Websites can only access a user’s physical location through API request which the user can deny or accept. Hardware resources similar to the GPS sensor can be accessed through API only, therefore browser can regulate access and limit app activity.
The above principle is also used in contemporary mobile operating systems (iOS, Android), through which mobile applications must obtain permission before operation- this can be enforced through APIs. Example: In the event a developer attempts to access the camera via the camera API, you are able to deny the request for permission. Thereafter the application will not be able to access the device camera.
File systems which use permissions—like Windows, Mac, and Linux—have permissions imposed by file system APIs. An ordinary application lacks direct access to the raw physical hard disk, instead the application should access the file through an API.
Communication amid Services Done through API
The Google Maps API is seen to be used to embed the map on certain websites. Google reveals these APIs to web developers to plot complex objects on their website. Imagine if the APIs were non-existential, developers would have to go through the tedious process of compiling their own maps. Google is able to control access to Google Maps on third-party websites since it is an API, ensuring consistency and safety.
Few More Popular API Examples
· YouTube APIs: Google's APIs allows developers integrate YouTube videos and functionality into websites/applications. (YouTube APIs -YouTube Analytics API, YouTube Data API, YouTube Live Streaming API, YouTube Player APIs and others)
· Flickr API: Utilized by developers to access the Flick photo sharing community data. The Flickr API consists of a set of callable methods, and some API endpoints.
· Twitter APIs: Twitter offers two APIs. The ‘'REST API’ enables developers to access core Twitter data and the ‘Search API’ offer methods for developers to interact with Twitter Search and trends data.
· Amazon Product Advertising API: Provides developers access to Amazon's product selection and discovery functionality to advertise Amazon products aimed at monetizing websites.












