This tutorial needs an authenticated user to make the request. Please sign in with your GitHub account.

Requesting Data

Learn how to retrieve data from GitHub.

Check GitHub API

GitHub API

GitHub provides a way to request and interact with data on its platform. This makes it possible to use GitHub data in your application. For example, you can see all your favorite GitHub projects or show what code you are working. This interaction is done through a interface called an API. We provided examples of using GitHub's API to help you get started.

Retrieving your starred projects

You can retrieve your starred projects on GitHub using the /user/starred endpoint. Within this starter project, you can also use the services/github.py module, which makes it easier to make an authenticated request.

A GET request to the /user/starred endpoint using the github.py module would follow this format:


      github = GitHub(access_token=session['access_token'])
      results = github.get('/user/starred')
    

As a result, you will see your starred repositories below:

This example requires an authenticated user. Please log in to see your starred repositories.

Searching GitHub

The endpoint for searching GitHub projects is located at /search/repositories. You can use this endpoint to find projects on GitHub. Within this starter project, you also can use the services/github.py module, which makes it easier to make an authenticated request.

A GET request to the /search/repositories endpoint using the github.py module would follow this format:


      github = GitHub(access_token=session['access_token'])
      results = github.get('/search/repositories')
    

As a result, you should be able to search for GitHub projects below:

Please sign in to use the search functionality.