Using API Data
On the web today, there are many computers out there waiting for other computers to come request some information. We tend to think only of the websites that are made for human eyes, but there is a whole ecosystem of services and sites meant to be used by our applications. We call these machine-oriented endpoints "Application Programming Interfaces" (APIs), and they are often terribly difficult for new web developers to grasp. The problem is partly that most APIs are used behind the scenes, and until very recently nobody ever talked much about APIs in polite company.
Another problem with understanding APIs is that the concept of an "API" applies to many different situations. We hear developers talk about the JavaScript API, the Vue.js API, the jQuery API, or myriad other specific modules, libraries, and frameworks. Why do we use the same words to describe both the web-based services that can supply data and functionality to our apps and the special words and symbols we use to invoke specific behaviors in programming languages and libraries?
The answer is: Interface. APIs are the way we communicate with the machine. We use a very controlled vocabulary to ask a machine to do something for us, and then it performs that task according to predefined routines. This is what an API is for: Communicating to a software system. Because of this, it doesn't really matter whether we're communicating with a system that is living in our web browser or that's living on a remote server across the ocean.
A World of Services
We live in a world of web services. Our sites rely on services to handle authentication, to provide storage, to manage infrastructure, and much more. We integrate the features of other sites with ours so we can allow our users to share content, post messages, or invite friends. And even when we are building functionality strictly for ourselves, we want to leverage services to help us keep our components separate, autonomous, and easier to maintain or enhance.
As front end web developers, we become much more powerful when we can leverage third-party APIs to provide data and services we could not build entirely in the browser. We can retrieve almost any information and use almost any kind of function to make our sites better for our users if we only implement the proper API integrations. This is not necessarily an easy task, but it is possible.
And sometimes it's easy, too.