About: APIs

API is just an acronym which stands for Application Program Interface. All that means is that an application is exposing its functionality in a way that's easy for your application to interact with.

For example, Google Maps' API documentations can be found here and although it's a bit more complex than what we've done so far, it offers certain endpoints for our application to use in a programmatic fashion. There are plenty of guides or tutorials online to show you how to implement Google Maps' API in your application, so we're not going to spend time on it, but you get the point -- an API means offering a way for an application to interact with another application in a programmatically convenient manner.

Another API that's not a web-based one, is the API we've been using this whole time -- the browser's API! Yes my friend, all of those built in functions? Well some of them are original to ECMAScript specification (read: JS) itself, but stuff such as XMLHttpRequest, that we've already discussed, is part of the browser's API, which is just an interface for our application to interact with the browser's built-in functionality (in the case of XMLHttpRequest -- its ability to make requests over the Internet).

Must an application have an API in order for another application to interact with it? Nope, absolutely not.

Let's take for example the site Craigslist. Last time I checked Craigslist did not have an official API available for the public to use. So if one wanted to have their application post an ad to Craigslist automatically (which by the way is against their terms of use so I would advise against it), they would have to figure out a different way to do so. One way could be via closely inspecting the request/response cycle when they post an ad on Craigslist manually and then try to mimic it with their application. You can see all the data transferred from your browser to Craigslist and vice versa via the Network tab of your browser's DevTools (click the "Network" tab and execute the request). After you have all the information needed from your manual request (the endpoints the browser sends data to, the data it passes, and its formatting, etc.), you could theoretically repeat the same steps programmatically w/out a problem.

APIs could also have nothing to do with web applications. For example the Apple iPhone and its OS (Operating System), iOS, have their own API, which is not used over the net, but rather is consumed via built in methods the developer can use (for example: to interact with the device's geolocation and other functionality) much like the browser's API we've mentioned before.

Other APIs out there

Most likely most of the stuff you need to create your application is already available in an API of some sort. To find APIs for maps, social applications, videos, music, etc. etc. use Google. You can also search for them here.

Table of Contents
Home