From the course: Build Three Real-World Python Applications

What are APIs?

- I recently consulted with an organization where we had to gather exchange rates data for our analysis. Unfortunately, it was difficult for us to find this information online, but we were able to use an API instead to gather the data. Let's discuss a bit about what APIs are. APIs are a type of software interface that allow two or more software programs to communicate with each other. APIs are composed of code that describes how information is exchanged between two or more software programs. For example, APIs can help exchange data between a company's database and an application on a computer or cell phone. Usually an API acts as a vessel to send and receive information. The software that creates the API publishes the information gathered. The software that wants to access the information from the API calls the information. APIs typically have a software interface where users can use the API's functionality. Sometimes there is specific code users can type out to call the information. Other times there is a website where users can select what information they wish to pull from the API. In this course, we will focus on web APIs, which are a subset of APIs. A web API is an API that communicates between a web server and a web browser. For example, there's a Twitter API that can read and write data between a coding language like Python and the Twitter social media platform. Many of the web APIs are called REST APIs. Rest APIs follow the REST software architecture style. REST stands for representational state transfer and this style describes a uniform software interface between physically separate components, such as a web API communicating between a web server and a web browser. The API we will be working with in this course is called Alpha Vantage and it is also a REST API. So why do APIs matter in the first place? APIs allow us to gather information from sources that may be difficult or impossible for us to gather from otherwise. For example, some websites do not allow people to scrape from them directly, so maybe we could use an API the website provides to gather that information instead. We will explore the Alpha Vantage API in this chapter.

Contents