Create a personal access token
You need a personal token to access the GitHub API.
Go to your GitHub account and then Settings – Developer Settings – Personal access token.
Then create a new token and add a descriptive name for your token e.g. the name of your website.
Please bear in mind that this token could be used to access, edit or delete information from your GitHub personal account. Therefore it is important to be careful and limit the access that you actually provide to this specific token. The different levels of access can be set by specifying the scope.
For the purpose of this article, we will only need to access public resources so only the most limited access to the API will be provided to the token. This can be achieved by leaving unticked all scopes. This is called (no scope) by GitHub.