What are APIs?
Read on to find out more about what an API is and their uses
Have you ever made a payment with PayPal, asked Alexa for the weather or logged into an application using Facebook? All of these tasks use API integration. Although you may not realise it, APIs are everywhere and are extremely useful. They allow us to share data, inspire new ideas and have helped speed up the development of new products.
APIs are present in everyday life
Let’s look at some examples of commonly used APIs to put this knowledge into everyday life. Geocoding APIs are some of the most well known and well used today. Have you ever browsed for flats using the map on AirBnB or checked the location of a shop on a map displayed on a site? The chances are they were using Google Maps API or another geo API such as MapBox. Google Maps API is so widely used as it was created way back in 2005 and almost every web page that displays a map uses it. What developers love about the Google Maps API is that it allows you to customise the map and markers to fit with your branding. Thanks to Google’s hard work, not only do you have access to a ready-built map and all of their complex features, but you can design and style it to suit your site and make it look like you did in fact build it from scratch!
Why are we using APIs?
The technical aspect of APIs
That all sounds great, but how do we actually use the API’s service? Let’s get a bit more technical! The API’s service, i.e. the map functionality from Google Maps, is exposed via URLs which are triggered by HTTP requests made up of a verb and a URL. If you have ever tried to get data from another source on the internet, you have probably heard of REST. REST is basically a set of conventions or rules, which are followed when APIs are created. When dealing with RESTful APIs, only a select number of verbs are used in the HTTP request, depending on the operation we are carrying out on the API’s database. When an API is RESTful, it means that there are four main operations that we can perform on its database - we can Read, Create, Update and Delete. For example, when you log into a website or app and select the option 'Log in with Facebook', some code is triggered, which "calls" the Facebook API via an HTTP request (developers say ‘calling an API’). This request will then trigger a response from the Facebook API which will contain the information of the user (using cookies facebook can tell which user is connected on the laptop you're using). The response sends back your information (email, name, profile photo), which is then saved to the database of the site or app you're trying to log in to. Here is a sketch to bring the logic to life:
APIs are great for business. It is unbelievable to think that many services, such as Twilio, have been so successful with just an API as their business model. Not only have APIs changed the business market, but they have also improved the way developers build and design products and prototypes. APIs abstract complexity and are easy to integrate on top of products. This allows us to build prototypes quickly and effectively with fewer constraints and therefore more creativity. They have completely transformed the web’s landscape and continue to inspire ideas for many entrepreneurs and developers around the world. Now it’s time for you to explore the powerful world of APIs and see what you can achieve!