In preparation for project week, I began looking into APIs but found it hard to wrap my head around the definition after staring at labs all weekend.

So let’s break it down into language anyone can understand.

API stands for Application Programming Interface.

In simple language, API is the messenger. It takes requests, tells a system what you want to do, and then returns the system’s response back to you.

It helps to keep in mind how the Web works.

Every page on the internet is stored on a remote server. When you use your computer to access a webpage a copy of the webpage’s files are displayed in your web browser.

  • Clients are the typical user’s internet-connected device (ex. your computer or phone, connected to Wi-Fi).

For example, when you open your laptop and go to www.twitter.com your machine sends a request to Twitter’s remote server. The server’s response is then interpreted and displayed by your browser of choice (ex. Chrome).

API is the part of the remote server that receives requests and sends responses. More specifically it is the code that governs the access points for the server.

APIs provide us with a way to query servers and databases for data so that we can manipulate it in our own applications.

APIs get us access to data from outside sources that is kept up to date automatically. So useful!

Imagine if you wanted to build an app that showed the weather for the week. You would want the information provided to be updated if the forecast changes, without having to go into the app and update it manually. Querying a weather data API (like Weather Underground) would allow you to integrate and display up to date weather information in your app!

APIs usually return data in JSON (JavaScript Object Notation) which stores information in key/value pairs. This makes JSON easy to read and access for applications written across multiple programming languages, including Ruby, Java, and Python.

APIs are full of potential, they allow you to communicate and build across applications. I’m excited to put what I’ve learned to use this week!

Software Engineering Student @ Flatiron School