Consuming an API Concepts

Learning objective: By the end of this lesson, students will understand what it means to consume an API.

Third Party APIs

Third-party APIs are how we refer to API’s created by a company, organization, or individual that is not you. They organize data or services into an easily usable (usually RESTful) format that others can access. Using or consuming an API is a great way to add functionality to your application without building it yourself. There are APIs for almost any industry or type of data you can think of, from weather to sports, movies, music, food, and more!

Here are a few collections of third-party APIs to explore:

Keep in mind, the above resources are curated lists and not exhaustive of what is out there. It’s always a good idea to do a quick Google search for the type of API you are looking for.

API Documentation

Say you’ve found an API you want to use; now, what?

The first step is to read its documentation. The documentation will provide important details such as what data or services are provided, what endpoints are available to access them, and how to make requests for those resources.

Documentation quality can vary from API to API. Some have excellent documentation that is easy to read and understand. In contrast, others may have documentation that is confusing, unclear, or outdated. It’s essential to read carefully and ensure you understand the API before deciding using it.

A few key things to look for in documentation:

Before issuing an API key, an API provider will typically require you to sign up for an account. At that time, you will be given information on the rate limit, which is the number of requests you can make to the API in a given period. If you exceed the rate limit, you will get an error from the API. Many companies will charge a fee to increase the rate limit, make sure you are aware of your usage and the risks associated with supplying payment information. Other restrictions can include being unable to use the API for commercial purposes. All of these are essential things to know before you start building a project.