How to get the number of forks of a GitHub repo with the GitHub API? -
i use github api v3 forks count repository, use:
get /repos/:owner/:repo/forks
the request bring me 30 results if repository contain more, googled little , found due memory restrict api return 30 results per page, , if want next results have specify number of page.
only me don't need information, need number of forks.
there way number of forks?
because if start loop page per page script risque crash if repository contain thousand results.
you can try , use search query.
for instance, repo vonc/b2d, use:
https://api.github.com/search/repositories?q=user%3avonc+repo%3ab2d+b2d
the json answer gives me "forks_count": 5
here 1 more 4000 forks (consider first result, meaning 1 "full_name
" "strongloop/express
")
https://api.github.com/search/repositories?q=user%3astrongloop+repo%3aexpress+express
"forks_count": 4114,
Comments
Post a Comment