Mathu
Mathu

Reputation: 63

Rate limit of authenticated git API request

I'm using authenticated Git API request using access token. But still, I get the request rate limit 60 req/hr. But the document says, for authenticated requests the rate limit is 5000 req/hr. Why I'm getting 60 req/hr. or is there any wrongs in curl comment which I'm using?

Eg: curl -H "Content-Type: application/json" -H "authToken: xxxxxxx" -i https://api.github.com/repos/d3/d3/git/refs/tags/3.5.3"

Upvotes: 1

Views: 440

Answers (2)

karthick
karthick

Reputation: 12176

Your syntax for sending the OAuth Token is wrong. You need to use either this format

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

(or)

curl https://api.github.com/?access_token=xxxxxxxxxxxxxxxxx

Reference: https://developer.github.com/v3/#authentication

Upvotes: 1

anurag0510
anurag0510

Reputation: 763

Well as per git documentation which says :

For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.

But if you needs to make unauthenticated calls with a higher rate limit, you can pass your app's client ID and secret as part of the query string.

Eg :

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

Please refer to link for further information : the unauthenticated rate limit for OAuth applications

Upvotes: 0

Related Questions