What is an API? And Why Should I Care?

In the same way that user interfaces allow us to interact with an application, Application Programming Interfaces (API) allow applications to interact with applications.


What is an API?

 

How do API’s work?

This is best illustrated by example. If you have ever witnessed a Twitter bot randomly like or retweet your tweet, you have seen an API in action. Twitter offers an API so that other applications (bots included) can send and retrieving information to and from Twitter.

 

Example Twitter Bot

 

An example of an application that retrieves information from the Twitters API is this sentiment visualizer. The application makes a “call” to Twitter’s API to retrieve some tweets (structured as JSON). It then processes this data and visualizes the tweets. Alternatively, some apps, like Buffer, send information to Twitter’s API to post Tweets on a Twitter user’s behalf.

Why do API’s exist?

 Applications use API’s for many reasons. One of the most important reasons is scale. Consider searching for a flight on skyscanner.net. Skyscanner can present flight options from a wide variety of carriers because it can access those carriers systems programmatically. In the past, travel agents would have to call carriers for price information one-by-one. Now, Skyscanner can retrieve current pricing data in an instant. Without API’s, it would be impossible for each carrier to enter a real-time auction.

 

API at Scale

 

API’s also provide applications with new ways to monetize their service. Weather Underground offers a website to users but also provides a monetized API so that other applications can user their weather data at scale.

 

So why should I care?

The phrase, “X is an API for Y” is becoming increasingly common. We see this as the businesses begins to shift their thinking to more digital-centric models. The term can be used both figuratively (“Uber is an API for transportation”), and literally (“Cloudsight is an API for image recognition”).

Having a sense about how API’s work enables more creative thinking about how different services can be combined. This insight provides an opportunity to create more interesting and more valuable applications. API’s can also be used to solve common problems. For example, if there is a problem that involves repetitive computation, classification or information retrieval, it is likely that someone has created an API to solve it. An example of this type of task would be CloudSight’s API for image recognition.

Finally, understanding how API’s work enables business people to envision how problems can be decomposed into replicable solutions with clearly defined inputs and outputs.

 

How can I explore an API?

    • IFTTT (If This Then That) is a perfect example of how API’s can be combined to automate common tasks. As a user, you select one event as a trigger (eg. IF Digital Atomics posts a new post) and another event that you would like to be triggered (eg. THEN you post a post to Facebook) and IFTTT would handle all the details in between.
    • Try Postman. For a bit more “bare metal” look at REST API’s, you can use Postman to explore what data can be retrieved from a given API. It
    • Read API Documentation. API documentation reads like a blueprint for an application. The “docs” detail the inputs and outputs of an application without the user interface. Just search for an application of interest and add “ api” to the end and you’ll find the docs. Try: https://www.google.com/search?q=instagram+api
    • Want more? Build your own with RapidAPI. This startup recently launched an “API as a service” that allows anybody with a minimal knowledge to drag and drop their way into creating their own REST API.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *