Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
In [ ]:
import requests
token = "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
List public repositories of an organization.
In [ ]:
resp = requests.get(
url="https://api.github.com/orgs/legendu-net/repos?per_page=100",
headers={
"Accept": "application/vnd.github.v3+json",
},
)
resp
In [ ]:
len(resp.json())
List all repositories of an organization by providing a personal access token which has read access to private repositories.
In [ ]:
resp = requests.get(
url="https://api.github.com/orgs/legendu-net/repos?per_page=100",
headers={
"Accept": "application/vnd.github.v3+json",
"Authorization": f"token {token}",
},
)
resp
In [ ]:
len(resp.json())
In [ ]: