If you’ve been hovering around the tech industry for a while (whether you’re looking for a career transition or you love binge watching tech reviews on YouTube), chances are you’ve heard of APIs. Maybe someone has mentioned them to you in conversation, and you nodded enthusiastically and made a mental note to look it up later. Many tech-enthusiasts have a vague idea about the term, but often without detail. Time to fix that today.
What Does API Stand For?
Let's start with the basics. API is an acronym for 'Application Programme Interface'. Don't get it mixed up with an IPA (Indian Pale Ale.) Unless of course, you're in a bar and have sunk a few of the latter already.
APIs are everywhere and most large organizations build them for either internal use and/or for customer use. Here are some common examples of APIs:
Weather or traffic snippets
The ability to log into a system via your social media account
Twitter bots that automatically refeed or share content
Paypal payments within a website
Travel booking sites that aggregate third-party data
-Weather or traffic snippets
-The ability to log into a system via your social media account
-Twitter bots that automatically refeed or share content
-Paypal payments within a website
-Travel booking sites that aggregate third-party data
How APIs Rule the Internet
APIs act as primers to remote servers and the web. The web is basically a vast network made up of interconnected servers. Each web page is stored on a remote server somewhere - your laptop for a staging site, or at a commercial remote server perhaps.
Type a URL in your browser and it will go to the relevant server. When the browser picks up the response, it will read the code and display the correct page. In this instance, the server is the API. So when you visit a webpage, you are interacting with the API of a remote server. The API is the part of the server that takes the requests and submits coded responses.
APIs may also be packaged and delivered as customer products, perhaps to sell access to traffic, weather or inventory data for example. Say you want to create an appointment reservations system for customers booking in for a car service at your garage, with the option for them to automatically add a Google calendar event to their calendar. You'd use an API, so that your website server would send a request to Google's server, providing the given details so that Google would return with a code response, for your server to receive, process and send to the browser in the form of a user confirmation message. Your browser might actually also be able to bypass your server altogether and get straight to the Google server.
What's a client in the context of APIs?
If an API request is made by your website server, then it's the client. This is similar to your browser becoming the client when you use it for website navigation. For users, the API lets them carry out defined actions within a single website. For this reason, most modern websites use a range of third-party APIs for the best possible, smoothest customer experience all within the site.
We've got an API for that
Where a potential problem exists on a website, there will usually already be a third-party, off the shelf solution in the form of a service or library. It tends to be easier - and likely more reliable - to make use of an existing and trusted solution.
Development teams use APIs to allow multiple servers to talk to each other. Often these servers act as helpers to a primary application server - and they're known as microservices when they do.
If an organization offers a customer API, this simply means they've developed a set of custom URLs that deliver responses in a pure data form. This means that the response won't be formatted or presented in a reader-friendly way - like the graphics you'd usually see with a website page. It's just data.
You can often make the same requests with a browser, as HTTP transmissions also occur in the text and your browser will display the best response it can.
Can you make these requests with your browser? Often, yes. Since the actual HTTP transmission happens in text, your browser will always do the best it can to display the response - often a JSON response that can be used readily in code. It's easy for developers to extract data from the returned text and use it for their application.
An application can be many things. For example, it could be a piece of functional software designed to do one thing. It can also be a small part of an app, the entire app or even a whole server. Basically, if a piece of software can be stripped from its environment, it can be classed as an application in the context of an API - and furthermore, it will probably have some variety of API in its own makeup.
Here's an example:
When developers use object-oriented design, they organize code into objects. There may be hundreds of these defined objects interacting with each other in the application.
Every object will have an API that will be a set of public properties and methods to allow it to interact with other application objects. The object may also have a private inner logic which is hidden from the external scope and not an API.
Ready to Learn Web Development?
Now that you’re familiar with APIs…are you hungry to learn more?
A Web Development bootcamp can fast-track your career in tech and get you building something that you love. With remote, hybrid, and on-campus options, Ironhack’s bootcamps are ready to help you change your life!
Whether you want to learn new skills to kick-start a career, to change your career path, or simply to place yourself firmly at the heart of the new digital economy, you will find courses to meet your needs, all delivered by experienced, engaging and exciting professionals in the field.
So, are you ready to learn Web Development with Ironhack?