Skip to main content

Command Palette

Search for a command to run...

What even is an API?!

Published
3 min read

I’m sure if you’re like me a few months ago, you’re probably asking yourself the same question: “What even is an API?” Hopefully, my hours of reading articles and watching YouTube videos will help clarify some of the concepts around what an API is and why it's useful.

API Overview

API stands for Application Programming Interface. In layman’s terms, it’s basically a way to interface with an application using programming. (You see what I did there?)

One way I usually like to explain APIs is by saying that there is a pool of information (usually in a database) that you want to interact with, but you want a simpler way to access it.

Let’s use the Chuck Norris Joke API as an example. Let’s say you want to create a website for your friends who love Chuck Norris jokes, and you want them to see a new one each time they either press a button or visit your site. You could just make a list of jokes and pull from it. Problem solved.

But let’s say your memory isn’t that great and you don’t want to maintain a text file or set up a database to store the jokes—that would be a pain to create and manage. You know there’s a place online with an endless supply of Chuck Norris jokes, all ready for you to access. They’re easily available—you just need to know how to ask the website for the information. That’s where an API comes in.

With RESTful APIs, requesting information is as easy as going to a specifically formatted URL, saving the results in your program, extracting the pieces you want (like just the joke), and integrating that information into your code however you need. That’s the power of APIs.

Chuck Norris jokes are fun, but what if you want to make something more useful?

Let’s say you want to create an app that manages your money by setting up a personalized schedule to transfer small amounts from checking to savings. For this example, let’s assume your bank’s app doesn’t already do that—but they do have secure systems in place to allow authenticated users access to their own accounts. This shows how you can take a “pool” of information from somewhere else, interface with it through an API, and integrate it into your own personalized application.

Conclusion

Hopefully, this has demystified APIs a little. I know I didn’t dive into the details like the different types of APIs or exactly how to make a request, but I like to think that having a 50,000-foot view of the core concepts helps lay the groundwork for deeper learning later.

As always, I hope you learned something new—and stay curious!