APIs and How to Use Them

Posted on — By Kevin Duong-Tran

When I talk to students taking coding courses, a common thought I often hear is that they are learning how to code but don’t know how code comes together to make something usable. Something practical. Running code on a local machine is fine at first, but it’s only a small percentage of what you can do. This is when I recommend looking into APIs.

What are APIs?

An API (Application Programming Interface) is the way software interacts with other software. There are many reasons why service APIs are used. Convenience is one. Would you want to code out a credit card processing service? Would you want to create your own service to track time and timezones?

Accessing large databases can also be simplified using APIs. With Google Places API, you can query for a listing of places (restaurant, bowling alley, etc) on a given geolocation. Last but not least, it’s fun to create your own custom controls. This Tesla Model S API Documentation allows you to control and request states of your Tesla…. 😀

How do I use them?

Here’s a breakdown on how to use an API. Say I want to build a display that shows a 5 day weather forecast. The first thing I would do is search for a “Weather API”. This gives me a list of weather data providers that offer their services for free. A look through their documentation to find examples on querying their data into an app. At that point, having an application get that data can be as easy as placing an HTTP request.*

As a parting gift, here’s a list of services and their APIs that you can use for your next (or first) project!

*Generalization of setting up an API call. In case of errors and frustration, consult google.com or play ping pong. Upon success, side effects may include learning how the internet works, gaining extra marketable skill(s), and feelings of self accomplishment.