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

后端 未结 5 868
礼貌的吻别
礼貌的吻别 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:34

    In order to increase the API rate limit you might

    • authenticate yourself at Github via your OAuth2 token or

    • use a key/secret to increase the unauthenticated rate limit.

    There are multiple ways of doing this:

    Basic Auth + OAuth2Token

    curl -u :x-oauth-basic https://api.github.com/user

    Set and Send OAuth2Token in Header

    curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com

    Set and Send OAuth2Token as URL Parameter

    curl https://api.github.com/?access_token=OAUTH-TOKEN

    Set Key & Secret for Server-2-Server communication

    curl 'https://api.github.com/users/whatever?client_id=xxxx&client_secret=yyyy'

提交回复
热议问题