1 00:00:07,870 --> 00:00:11,285 Hey everybody, welcome back. 2 00:00:11,285 --> 00:00:13,670 REST APIs this lesson. 3 00:00:13,670 --> 00:00:19,285 API, it's an acronym that stands for Application Programming Interface. 4 00:00:19,285 --> 00:00:22,530 It's an interface that lets one computer program interact with 5 00:00:22,530 --> 00:00:26,010 another computer program and rest. 6 00:00:26,010 --> 00:00:28,985 Not rest as in take a deep breath and relax. 7 00:00:28,985 --> 00:00:31,040 It's another acronym that stands for 8 00:00:31,040 --> 00:00:35,675 Representational State Transfer which actually isn't all that helpful either. 9 00:00:35,675 --> 00:00:37,910 Purists will be happy to explain to you at length 10 00:00:37,910 --> 00:00:41,120 the more abstract meaning for Representational State Transfer. 11 00:00:41,120 --> 00:00:42,800 But in everyday parlance, 12 00:00:42,800 --> 00:00:45,410 a REST API just means a website that produces 13 00:00:45,410 --> 00:00:48,540 data intended for another computer program to consume, 14 00:00:48,540 --> 00:00:53,160 rather than something intended to be displayed to people in a browser. 15 00:00:53,320 --> 00:00:56,480 A REST API will respond to requests in 16 00:00:56,480 --> 00:01:01,310 a particular format and some things are common across many APIs about the format, 17 00:01:01,310 --> 00:01:04,685 but some things are specific to the particular API. 18 00:01:04,685 --> 00:01:10,534 This week, you'll learn how to write programs in Python that interact with REST APIs. 19 00:01:10,534 --> 00:01:13,280 You'll learn to read the documentation in order to figure out 20 00:01:13,280 --> 00:01:16,355 the specific format that the API is expecting, 21 00:01:16,355 --> 00:01:21,260 and you'll learn how to use the Python request module to make the API calls. 22 00:01:21,260 --> 00:01:24,350 Finally, you'll learn about caching as a way to 23 00:01:24,350 --> 00:01:28,190 reduce the total number of calls that you have to make to the APIs. 24 00:01:28,190 --> 00:01:32,310 Before we dive into details of request APIs though, 25 00:01:32,310 --> 00:01:35,690 we're going to take a little detour to give you some background on what 26 00:01:35,690 --> 00:01:39,890 goes on behind the scenes when two computers talk to each other over the Internet. 27 00:01:39,890 --> 00:01:42,350 It'll give you a mental model of what's going 28 00:01:42,350 --> 00:01:45,410 on so that if things don't work perfectly the first time, 29 00:01:45,410 --> 00:01:48,140 and they never do, you'll know how to think about 30 00:01:48,140 --> 00:01:52,110 what might be going wrong and have a good path toward fixing it. 31 00:01:52,150 --> 00:01:54,215 At the end of this lesson, 32 00:01:54,215 --> 00:01:57,395 you'll be able to parse a URL into its component parts, 33 00:01:57,395 --> 00:02:00,740 the protocol HTTP or HTTPS, 34 00:02:00,740 --> 00:02:04,375 the host, typically a domain name, and the path. 35 00:02:04,375 --> 00:02:09,665 You'll also be able to use the Python request module to fetch the contents of a URL. 36 00:02:09,665 --> 00:02:13,290 Let's get started. I'll see you at the end.