REST ENDPOINT /user/repos not showing Private=false repos inside an Organization

I am trying to retrieve all public repos using the /user/repos endpoint but it is only returning results for public repos owned by my user outside the organization.

 https://api.github.com/user/repos?page=1&per_page=100&visibility=all&affiliation=owner%2Ccollaborator%2Corganization_member

Hi @ajanoni,

Thanks for being here, could you try passing the param affiliation=all?

Hi, already tried every single option without success. Sorry.

If you want to see all repos that you have access to, then you should leave the affiliation parameter at the default value. affiliation=owner restricts the output to repositories that you directly own, in other words repositories that can be found under https://github.com/ajanoni.

So if you want to see all public repos that you have access to, you can use the following URL as a base:

https://api.github.com/user/repos?visibility=public

I hope that helps.

1 Like

However, if this was a private account and the developer cannot afford to set that setting to true…