1 00:00:07,359 --> 00:00:14,080 In this video we will discuss Application Programming Interfaces, or APIs. Specifically, 2 00:00:14,080 --> 00:00:20,410 we will discuss: What an API is, API Libraries, REST APIs, including: 3 00:00:20,410 --> 00:00:28,050 Request and Response. An API lets two pieces of software talk to each other. For example 4 00:00:28,050 --> 00:00:34,270 you have your program, you have some data, you have other software components. You use 5 00:00:34,270 --> 00:00:40,820 the API to communicate with the other software components.You don’t have to know how the 6 00:00:40,820 --> 00:00:47,860 API works, you just need to know its inputs and outputs. Remember, the API only refers 7 00:00:47,860 --> 00:00:53,510 to the interface, or the part of the library that you see. The “library” refers to 8 00:00:53,510 --> 00:01:00,760 the whole thing. Consider the pandas library. Pandas is actually a set of software components, 9 00:01:00,760 --> 00:01:05,070 many of which are not even written in Python. You have some data. 10 00:01:05,070 --> 00:01:10,460 You have a set of software components. We use the pandas API to process the data 11 00:01:10,460 --> 00:01:16,600 by communicating with the other software components. There can be a single software component at 12 00:01:16,600 --> 00:01:22,810 the back end, but there can be a separate API for different languages. Consider TensorFlow, 13 00:01:22,810 --> 00:01:29,049 written in C++. There are separate APIs in Python, JavaScript, 14 00:01:29,049 --> 00:01:35,500 C++ Java, and Go. The API is simply the interface. 15 00:01:35,500 --> 00:01:42,010 There are also multiple volunteer-developed APIs for TensorFlow; for example Julia, MATLAB, 16 00:01:42,010 --> 00:01:51,000 R, Scala, and many more. REST APIs are another popular type of API. They enable you to communicate 17 00:01:51,000 --> 00:01:54,770 using the internet, taking advantage of storage, greater data 18 00:01:54,770 --> 00:02:01,540 access, artificial intelligence algorithms, and many other resources. The RE stands for 19 00:02:01,540 --> 00:02:08,610 “Representational,” the S stands for “State,” the T stand for “Transfer.” In rest APIs, 20 00:02:08,610 --> 00:02:14,510 your program is called the “client.” The API communicates with a web service that you 21 00:02:14,510 --> 00:02:21,120 call through the internet. A set of rules governs Communication, Input or Request, and 22 00:02:21,120 --> 00:02:28,730 Output or Response. Here are some common API-related terms. You or your code can be thought of 23 00:02:28,730 --> 00:02:35,720 as a client. The web service is referred to as a resource. The client finds the service 24 00:02:35,720 --> 00:02:42,370 through an endpoint. The client sends the request to the resource and the response to 25 00:02:42,370 --> 00:02:50,810 the client. HTTP methods are a way of transmitting data over the internet We tell the REST APIs 26 00:02:50,810 --> 00:02:57,930 what to do by sending a request. The request is usually communicated through an HTTP message. 27 00:02:57,930 --> 00:03:04,530 The HTTP message usually contains a JSON file, which contains instructions for the operation 28 00:03:04,530 --> 00:03:10,849 that we would like the service to perform. This operation is transmitted to the web service 29 00:03:10,849 --> 00:03:17,250 over the internet. The service performs the operation. Similarly, the web service returns 30 00:03:17,250 --> 00:03:23,080 a response through an HTTP message, where the information is usually returned using 31 00:03:23,080 --> 00:03:27,269 a JSON file. This information is transmitted back to the 32 00:03:27,269 --> 00:03:32,030 client. The Watson Speech to Text API is an example 33 00:03:32,030 --> 00:03:40,330 of a REST API. This API converts speech to text. In the API call, you send a copy of 34 00:03:40,330 --> 00:03:47,750 the audio file to the API; this process is called a post request. The API then sends 35 00:03:47,750 --> 00:03:55,280 the text transcription of what the individual is saying. The API is making a get request. 36 00:03:55,280 --> 00:04:00,800 The Watson Language-Translator API provides another example. You send the text you would 37 00:04:00,800 --> 00:04:08,080 like to translate into the API, the API translates the text and sends the translation back to 38 00:04:08,080 --> 00:04:14,860 you. In this case we translate English to Spanish. In this video, we’ve discussed 39 00:04:14,860 --> 00:04:22,740 what an API is, API Libraries, REST APIs, including Request and Response. Thank you 40 00:04:22,740 --> 00:04:24,119 for watching this video.