Our Blog

The coder’s guide to APIs

The coder’s guide to APIs

As a coder, you have probably heard of APIs but you may not be entirely sure what they are. If used correctly, APIs can vastly enhance a user’s experience of a platform, site, or app, and as such should be properly ulitised by those that create them.

This is the coder’s guide to APIs.


1. What is an API?

As a coder and regardless of what language you are using, the chances are that you are already using APIs without even realising it. In layman's terms, an application programming interface (API) is a specification for the communication that takes place between two different software components. These APIs can take a number of different forms but will usually include a combination of data structures, methods, and functions. They work by providing pre-programmed functionality that you can then use to build an application. APIs allow developers to facilitate communication between software components whilst maintaining standardisation, openness, and reusability.


2. What is a browser API?

When it comes to the web, you are probably familiar with APIs such as Google Maps which can be integrated into your app or website. This is done by importing scripts that are hosted on Google's servers and then using functions from the scripts along with the API documentation provided.


3. APIs today

Did you know that the whole JavaScript ecosystem is made from APIs? Here are just some of the ones you may already be familiar with.

XMLHTTPRequest- A JavaScript API, XMLHTTPRequest is used to send asynchronous requests to a server. This means that data can be retrieved from the server and then used to update a page without the need to reload the whole thing.

Web sockets- This API allows two-way communications sessions to be created between the server and the browser. Once this has been done, the server is able to update the user without the browser having to periodically poll the server. A good example of web sockets in action is on Stack Overflow where they are used to feed the live notifications of responses to queries and questions.


4. Third-party APIs

These are some of the most popular and widely used APIs on the market.
Facebook - Facebook’s Graph API allows websites and apps to get data and then write it to Facebook. Facebook content is represented as a set of nodes in a graph structure. The API also offers Graph API Explorer which allows authenticated users to test out a range of results from various calls to the API.

Twitter - Twitter has a few different APIs, all for different uses. The most basic of these is the Search Tweets API which allows users to search through historic tweets over a specific time frame or criteria.

YouTube - This API allows users to embed YouTube functionality into a webpage as well as giving them the ability to retrieve content and post content to the platform.


Authored by Finerton.com – June 2019
Pictures: Pixabay.com & Unsplash.com

Last modified on: June 28, 2019

Post A Comment