Is there a way to increase the API Rate limit or to bypass it altogether for GitHub?

后端 未结 5 967
礼貌的吻别
礼貌的吻别 2021-02-01 18:55

I am developing a web application which needs to send a lot of HTTP requests to GitHub. After n number of successful requests, I get HTTP 403: Forbidden with the me

5条回答
  •  青春惊慌失措
    2021-02-01 19:44

    Just make new "Personal Access Token" here and use simple fetch method (if you are coding in JS of course :D) and replace YOUR_ACCESS_TOKEN with your token.

    The best way to test it is to use Postman

    async function fetchGH() {
        const response = await fetch('https://api.github.com/repos/facebook/react/issues', {
            headers: {
                'Authorization': 'token YOUR_ACCESS_TOKEN',
            }
        })
        return await response.json()
    }
    

提交回复
热议问题