Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Which permissions need to be given for Github Personal Access Token? #1830

Closed
yqs112358 opened this issue Sep 9, 2024 · 11 comments
Labels
info/idea Ideas for features or documentation improvements

Comments

@yqs112358
Copy link

I have generated a Fine-grained Github Personal Access Token with Public Repositories (read-only) repo access. However, when I was searching and adding a batch of apps from Github, I still faced with API request rate limit (need to retry 30 minutes later).

So... which permissions exactly need to be given for Github Personal Access Token to improve API request rate limit?🤔

@grm34
Copy link

grm34 commented Sep 9, 2024

the token should only need the minimal read access permission

See https://github.com/ImranR98/Obtainium/wiki#github

@yqs112358
Copy link
Author

image
This seems to be correct I think...
So it's strange to see the limitations again 🤔 I remember that with personal access token the request rate limitation will be up to 100,000 times in an hour.

@grm34
Copy link

grm34 commented Sep 9, 2024

No it's not. You must use classic token with read:packages perm which allows to Download packages from GitHub Package Registry

@ImranR98 ImranR98 closed this as completed Sep 9, 2024
@soredake
Copy link

@ImranR98 can information provided by @grm34 be documented on https://github.com/ImranR98/Obtainium/wiki#github page?

@ImranR98 ImranR98 reopened this Sep 10, 2024
@ImranR98 ImranR98 added info/idea Ideas for features or documentation improvements TODO Issue to focus on for the next release labels Sep 10, 2024
@Dev123456689
Copy link

Dev123456689 commented Sep 25, 2024

I have generate a personal token (classic) with access to both read public repo and read packages but I am still facing the API request rate limit issue. What should I do?

IMG_20240925_130034

@ImranR98
Copy link
Owner

Not sure what's going on here. I'm currently using a fine-grained token with no extra access:
image

@ImranR98 ImranR98 removed the TODO Issue to focus on for the next release label Sep 27, 2024
@js12h
Copy link
Sponsor

js12h commented Sep 27, 2024

I ran into this a few weeks ago. Try running this script and see what is returned. If your token is correct and accepted, it will show 5000.

Mine wasn't and I ended up creating a new Github account, using a real email address (instead of an alias like I normally do). Verified the email address w/ Github. Ran this command and it showed 5000. Don't know if my original email alias, even though authenticated, was causing the limit to stay low or if it was just an old account. Either way, I have been fine since I created a new account and verified the email address. The classic token works fine. I haven't tried the fine-grained token yet but will.

Note; w/ this script, you can use Bearer or Token:

curl -L
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer YOUR-TOKEN"
-H "X-GitHub-Api-Version: 2022-11-28"
https://api.github.com/rate_limit

@js12h
Copy link
Sponsor

js12h commented Sep 27, 2024

Just tested the fine-grained token and verified it works as well. Though for now I will stick w/ the classic token.

Also, make sure you have validated/verified your email address w/ Github. I seem to recall reading somewhere that it needs to be verified to have the rate limit increased.

Hope this helps.

@ImranR98
Copy link
Owner

Thanks @js12h
Added a line to the Wiki: https://github.com/ImranR98/Obtainium/wiki#github

@yqs112358 please try those steps. We can re-open the issue if https://api.github.com/rate_limit shows you a high limit but Obtainium still gets rate limited.

@yqs112358
Copy link
Author

Okay, I have tested the request and returned a correct result:

"rate": {
    "limit": 5000,
    "used": 2,
    "remaining": 4998,
    ...

BTW I haven't encountered rate limit again recently. It seems to be OK all the time. 😊
I will try to query this API in case I encounter it again in the future. Thanks so much!

@js12h
Copy link
Sponsor

js12h commented Sep 28, 2024

Excellent. Glad to see everything is working well for you now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info/idea Ideas for features or documentation improvements
Projects
None yet
Development

No branches or pull requests

6 participants