Carswell Gould web developer, Giuseppe Sciascia, shares his expertise on application programming interfaces (API), including what they are, how they’re used and how they positively affect the profitability of a business.
So, what is an API?
API stands for Application Programming Interface. Simply put, APIs allow different apps to communicate and exchange data or services with each other. The classic definition for this is ‘a set of subroutine definitions, protocols and tools for building application software’ or ‘a set of clearly defined methods of communication between various software components’.
What are common uses of APIs?
On a day-to-day basis, you’ll probably see APIs without even realising. Some common examples of practical uses of APIs include:
· Social networks
If a company presents updates from its Twitter feed on its website, an API is in use, allowing communication between the website and Twitter
· Incorporated maps
If a map is shown on a website, like on Rightmove for example, an API is in use. This allows communication between the website and Google Maps
· Sign up via social media accounts
If a website allows a user to sign up to its website via personal social media accounts (instead of registering and filling in a form), an API is in use, allowing communication between the website and whichever social media platform is chosen
· Websites that use data from other websites
If a website uses data from another site, an API is in use, allowing communication between the sites. Examples include Trivago, which compares hotel prices from hundreds of different hotel websites, or Compare The Market, which compares insurance rates from hundreds of different insurance company websites
A short technical introduction
APIs enable software in different programming languages to communicate with one another. Different software has different languages, which is why protocol and guidelines are in place to make conversation easy and comprehensible between the parts.
If we are talking about web APIs, the protocol used is HTTP. This allows us to follow a simple request-response pattern.
In a classic request-response pattern in web flow, we request a page through a URL and receive an HTML page back.
Within the API, we make a request with a URL and VERB and receive a response made by a STATUS CODE + BODY.
Have we lost you yet? No? Great, let’s continue…
How is a request made?
There are four common request methods. These include get, post, put and delete:
· GET - asks the server to retrieve a resource
· POST - asks the server to create a new resource
· PUT - asks the server to edit/update an existing resource
· DELETE - asks the server to delete a resource
How is a response made?
Status codes are code numbers that represent a server response. Common codes include:
· 200 (OK) - Generic success
· 201 (CREATED) - Resource created
· 400 (BAD REQUEST) - Generic error
· 401 (UNAUTHORIZED) - User is not authenticated
· 403 (FORBIDDEN) - User doesn’t have rights to access the resource
· 404 (NOT FOUND) - Resource not found
· 500 (INTERNAL SERVER ERROR) - Generic server error
Internet of Things
APIs are also used for smart hardware, including smart thermostats, smart ovens and smart irrigation controllers. Here, the APIs allow the user to control their devices from their smart phone/tablet.
To do this a hardware producer builds a device, creates an API and then publishes this online. For example, Philips created ‘Hue’, a wireless lighting system that allows users to control the lighting in their home from their smart devices.
When a user wants to turn a light off, the API that Philips created looks like this:
There are also wearable examples, including Fitbit trackers, in which an API is used to retrieve time series data to show a user’s activity, exercise, sleep, weight etc.
That’s all well and good, but how does it make me money?
Ka-ching! Here’s the part where we talk about API economy – the way in which APIs can positively affect the profitability of a business. There are four main ways this can be done:
· Sell the use of APIs
· Use APIs to attract customers to your products and services, growing your customer base
· Use APIs to create new marketing strategies
· Improve integration (across channels) with web APIs
Amazon has created a complex, highly scalable web service that enables developers to use their infrastructure through APIs for computer power, database, file storage and other functionalities.
Amazon makes profit from this is by charging with rates based upon usage of CPU (central processing unit), storage or number of requests (each product has its own pricing table), with a pay-as-you-go business model.
PayPal allows businesses to access its API to integrate their platform with PayPal. Developers can design and host their own checkout pages whilst the payment processor works behind the scenes. PayPal makers profit from this is by charging a user transaction fee.
Social media platforms develop their APIs to increase brand awareness, which in turn results in companies using their platforms to advertise and engage with their audiences. For example, Twitter sells promoted tweets to marketers, earning approximately 85% of its revenue from advertising. Facebook’s single most important revenue channel is advertising, generating over half a billion dollars in revenue each year, the vast majority of which comes from advertising.
· APIs increase the brand awareness for products (software, apps, services)
· The development of APIs can allow our data to be available to third parties
· APIs can be used to create new business models for your company
· APIs = profit
To learn more about how to integrate APIs into your business, or to improve your digital marketing, get in touch with us today.