👨🏼‍💻 Access (HTTP) Web Data with REST APIs in Python

Published: 16 October 2020
on channel: Practical Python Solutions
669
18

❗️Don't forget to subscribe!
   / @practicalpythonsolutions-b4478  
-------
In this video we will learn how to use Rest APIs with Python.

❓What are rest APIs ❓
Rest APIs allow us to access and retrieve data over the web (typically via http) with a standard URL, much like you see in a web browser. For example, we can get location data for app, weather, social media activity, financial stats and much more. The possibilities are endless but the point is that your code can easily connect to these services on the internet

An API or Application Programming Interface , in its broadest definition is basically a set of rules that allow your code to talk to other applications.

APIs are everywhere and we’ve used them quite a bit in this channel to encrypt data and many other things

Rest APIs are a specific type of API that allow us to connect our code to other apps with http.

A developer creates the Rest API to a resource on a server. Let’s say for our example our developer wants to create an API that provide latitude and longitude coordinates for a given address. She makes here API accessible from a web site over port 443. We create a http get request that includes the URL and some parameters, like the address and our api key or access token, which we’re retrieved from the developer’s site.

We make a request to the api and the server returns the data, typically in json format, which we can easily parse to get the information we need.


That’s it. Easy. And of course we can send data was well with a http post method and much more. There are some requirements for an API to be a rest api or restful but most of these requirements are concerned with developing APIs.

So, let’s fire up a few real world examples in Pycharm to see how these actually work. The way I’m going to do this is, first, I’ll walk through the code, for those that just want to jump in, and at the end of the video I’ll walk you through how to get some free API keys to do this yourself. I’m going to work here with some common apis from google, twitter and a site call “rapid API”. I’m not really endorsing any of these apis but I found them to be relatively easy to use and, of course, free, which is not always the case with rest apis. There are cases where you need a paid developer account.


Watch video 👨🏼‍💻 Access (HTTP) Web Data with REST APIs in Python online without registration, duration hours minute second in high quality. This video was added by user Practical Python Solutions 16 October 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 669 once and liked it 18 people.