GitHub API issues

I was trying to setup CICD pipeline where i wanted to dynamically populate Repository list/project list and corresponding branch list using REST API. Sometime i am able to do it successfully but few of the ocasion i am getting below errors:

[message:API rate limit exceeded for 14.102.118.154. (But here’s the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.), documentation_url:https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting]

I see current rate is limited to 60 per hour is there a way i can get rid of this or increase this value so that i can hit my github as many times.

Also along with this error i am getting below error as well:
groovy.lang.MissingPropertyException: No such property: name for class: java.util.HashMap$Node

@Devender210590

Welcome to GitHub Community :wave: :wave:

You can create a PAT token. And send it in the header parameter. As you can make up to 5,000 request per hour.

Ex:

curl -i -H "Authorization: token ghp_16C7e42F292c6912E7710c838347Ae178B4a" \
    https://api.github.com/user/repos

Hi @parithiban

Thank you!!

Yes I am using PAT token only. Since I am using this at personal level. On checking I found that limit 5000 is for enterprise version.

Just wanted to see if there are any other way to do it apart from PAT token or any way to increase limit from 60 and beyond.

Thanks,
Devender

@Devender210590 If you are getting that error message, you are not successfully authenticating. The rate limit when you’re authenticated is 5000, unless you are an Enterprise customer, and then it’s 15000.

More detail available on GitHub API rate limiting.

We have help with authentication options as well.

1 Like

$ curl --request GET ‘https://api.github.com/rate_limit’ --header ‘Authorization: token ENTER-PAT-HERE’

The above command will confirm the validity of your token and the 5000 rate limit
if you omit the authorization header you will see a rate limit of 60 is returned