How to get list of PRIVATE repositories via api call #24382
-
How to get list of PRIVATE repositories via api call Using this command, it only retrieves the list of PUBLIC repositories… P.S. I also tried this and it didn’t work… |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 9 replies
-
I’m not sure this is the API you are looking for. https://api.github.com/search/repositories?q=user:USERNAME Without credentials, you will receive all public repositories of the user. |
Beta Was this translation helpful? Give feedback.
-
Thanks, that worked. It retrieves both public and private repos… curl -H “Authorization: token MYTOKEN” https://api.github.com/search/repositories?q=user:MYUSERNAME |
Beta Was this translation helpful? Give feedback.
-
I’m looking for an API which returns repos for an owner (a user or an org). In the docs, the search api has In my tests, both return the same results (ie they work for user:ORGNAME and org:USERNAME in addtion to user:USERNAME and org:ORGNAME) Is this intended ? Is it going to continue to work ?What’s the difference between the two ? Maybe the keyword “owner” should be used when referring to something that can be a user or an org. |
Beta Was this translation helpful? Give feedback.
-
Also
Could you improve (and maybe merge?) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I couldn`t get private repositories while i was using the wrong link. now api give me list of public and private repos |
Beta Was this translation helpful? Give feedback.
-
thanks sir! |
Beta Was this translation helpful? Give feedback.
-
is it possible to list private repos of other users? Im a GH Enteprise admin at my company, Im creating a python script via GH API that shows all GH users whenever a user leaves the company, I want to suspend the user, and also transfer his private repos to another organization called "ex-mployees" aka archive his private repos in case someone needs to access them the current API shows only public repos for a user, unless I'm querying my own username,
not sure if its possible to show private repos for users other than myself. |
Beta Was this translation helpful? Give feedback.
I’m not sure this is the API you are looking for.
Try this one:
https://api.github.com/search/repositories?q=user:USERNAME
Without credentials, you will receive all public repositories of the user.
With credentials you will also receive the private ones.