How to get list of PRIVATE repositories with api call #24787
-
We are trying to access a user’s repositories list (including public and private). For this we have created a GitHub App in a github account and we have given read permissions to everything. We try to make the following calls by passing it the Oauth 2.0 token: https://api.github.com/users/USERNAME/repos https://api.github.com/search/repositories?q=user:USERNAME This only returns the user’s public repositories. The next call also cannot access the private repositories We have also tried with {type: all} and {visibility: all} Hope you can help me access all repositories and commits, thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@Pcamachoc, any APIs will only provide publicly available information about another users GitHub account. Another users Private repository, or private email is not publicly available information. You can list the the private repositories of the authenticated/current user, or repositories they have access to. |
Beta Was this translation helpful? Give feedback.
-
@byrneh I’m following the guide in the List repositories for the authenticated user I’m listing user private repos throw /user/repos in GET request with the auth token |
Beta Was this translation helpful? Give feedback.
-
baselrabia:
I responded to your seperate thread on this
@baselrabia, If your token is valid, in most cases a case of no data being returned or 404 not found from REST APIs is due to insufficient token scope permissions. You can view and edit you tokens permissions from this URL https://github.com/settings/tokens Does you token have repo scope permission when you tried list-repositories-for-the-authenticated-user? |
Beta Was this translation helpful? Give feedback.
@Pcamachoc, any APIs will only provide publicly available information about another users GitHub account. Another users Private repository, or private email is not publicly available information.
You can list the the private repositories of the authenticated/current user, or repositories they have access to.
Maybe something like List repositories for the authenticated user