How to get list of PRIVATE repositories via api call

How to get list of PRIVATE repositories via api call

Using this command, it only retrieves the list of PUBLIC repositories…
curl -H “Authorization: token MYTOKEN” https://api.github.com/users/USERNAME/repos

P.S.
My token has all the checkmarks select to enable all permissions, and I still cannot retrieve the list of private repos.

I also tried this and it didn’t work…
curl -H “Authorization: token MYTOKEN” https://api.github.com/users/USERNAME/repos
-d “{“visibility”:“private”}”

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.

Thanks, that worked. It retrieves both public and private repos…

curl -H “Authorization: token MYTOKEN” https://api.github.com/search/repositories?q=user:MYUSERNAME