From the course: Python for Data Science Tips, Tricks, & Techniques

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Read data from GitHub API

Read data from GitHub API - Python Tutorial

From the course: Python for Data Science Tips, Tricks, & Techniques

Start my 1-month free trial

Read data from GitHub API

- [Instructor] Sometimes your data won't be local, and you'll have to get it from an API. So here I'm going to show you how to read some data from the GitHub API. I'm going to open up the exercise file here, 01_04, and I'm going to run through all these first, but the first thing I want to do is show you where the data lives. So the first thing we need to do is import the request module, which will allow us to send web requests and then retrieve that data. So as you can see here, the first thing we're doing is importing that, then we're going to create a new object for the response, and then issue the requests.git and the URL where our data lives. So if I copy this URL, and go over to a new tab, I'll just show you what it looks like here. And this is essentially the response that we're getting from the GitHub API. Now this API may change over time, but the main thing I wanted to explain here is that, with this what we have is something called content. This is actually the contents of…

Contents