Application Programming Interface (API) (video time: 32 minutes)
An Application Programming Interface (API) is a mechanism for communication between a client and server, designed to simplify the development of client-side software. We’re going to cover only Web APIs that use Hypertext Transfer Protocol (HTTP), although other types of APIs do exist. We’ll focus on a specific type of web API called a Representation State Transfer (REST) API, which has become widely used, because of fast performance, scalability and reliability. In this lesson, our goal is to learn how to use REST APIs as a consumer, not to build them as a developer.
Motivation
Suppose you’re running a business and you have a database of addresses for all of your customers’ locations. If you need to know how long it will take to drive from one customer to another, you could open you favorite map application and get driving directions. However, if you want to compile driving time estimates between every pair of customers, it would be tedious to search each of these pairs and record the times in a spreadsheet. If your business was large (e.g., UPS), this would be impractical, if not impossible. An API allows you to systematically retrieve this information in a consistent format, which you can then save to a file or a database.
Software Tools
Web APIs that use HTTP can be accessed through any software capable of sending HTTP requests and receiving HTTP responses, including:
- web browsers
- command line tools such as wget
- programming language libraries
MN3441 Technology for Managerial Data Analysis