Learning about web APIs

First, what is an API? Well, an Application Programming Interface (API) is an interface for working with a specific application programmatically—that is, via code. Think of Twitter bots or email clients—all of them use APIs to work with their corresponding applications (Twitter and email servers, respectively).

An API does not have to involve the web—many local applications on your computer have APIs of their own, so we can interact with them through Python or any other language. In our case, however, we need to work with a web API. Those APIs operate via HTTP requests and responses. Many contemporary APIs follow REST guidelines—a set of six design constraints that were put forward by Roy Fielding. You can learn more about REST architecture via REST API Tutorial (https://restfulapi.net/) or the Packt books cited at the end of this chapter. We will also talk about REST APIs in more detail in Chapter 18, Serving Models with a RESTful APIs, when we'll actually build one ourselves. 

All REST APIs communicate with the consumer via the HTTP protocol—the same protocol we're using in our browsers. Let's briefly discuss them now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.12.170