What is an API?

No comments

APIs are now ubiquitous in the business and IT world. However, the majority of non-technical people I meet have a vague or no understanding of what an API actually is. If you fall into this camp, don't feel bad! APIs can seem daunting because they appear to be very technical. In this post I going to help demystify what API is.

The Basics

API stands for application programming interface. An API itself is a set of routines, protocols, and tools for interacting with an application, system, or library. Sounds vague? That's because an API can take on many forms. In imaginary terms, you can think of an API as a set of levers, dials, and buttons you use to interact with some computer system. And the computer system can take on many forms, for example an application, a web service, a software library, a programming language, or a plugin. These levers, dials, and buttons are how you interface with a system.

These days, when people throw around the term API, they are almost certainly referring to a Web API. A web API is the same levers, dials, and buttons, but you pull, push, and turn them using a web browser or making programmatic calls over the web.

Web API Example with Twitter

 To demonstrate what a web API is, let's look at the Twitter API. Suppose one day you are reading your favorite blog or news website and you see a button (like the one below) that says "Tweet" or "Share this article on Twitter", or something of the like.


When you click that "Tweet" button, your article magically appears on your Twitter stream and the world turns. How did this happen? So, obviously some human didn't literally log into your Twitter account and type your tweet for you. What actually happened was the blog or news website you were reading (say BBC.com) programmatically talked to Twitter.com and made a request to Tweet the article you were reading to your twitter stream. In other words, BBC.com accessed the Twitter API and programmatically Tweeted the article for you. 

Like most APIs, the Twitter API is a two way street for data; you can send data like Tweets to the Twitter API and retrieve tweets as well. For example, you may have seen a company's Twitter timeline, like the one below, on their web page.


The Twitter timeline widget is a great example of how a web API can be used to extract data. Under the covers this widget accesses the Twitter API and makes a request to get a particular user's Tweets.

Conclusion

Basically, an API is an interface to interact with some computer system. When someone drops the term API at a cocktail party, they are most likely referring to a web API. 

In my next post I will highlight the benefits of having a web API.

Have any questions on how to make an API for your data? Email me at tristan@apitite.net or visit apitite.net and check us out.

References

No comments :

Post a Comment