5

I am using the below GitHub API call that is returning the stats from one of our repo's. The request is returning the data I need, but I am running into a known limitation with this API call that it will only show the top 100 contributors to the repo. We have around 500 contributors so I need to know any known work arounds to get this similar data beyond the top 100 contributors? I have tried to attached the ?page=2 however I did not see that work as well.

Here is the GitHub documentation for get-all-contributor-commit-activity That I am reading to make this request.

GET Request /repos/{owner}/{repo}/stats/contributors

JSON Retruned:

[
    {
        "total": 10,
        "weeks": [
            {
                "w": 1483833600,
                "a": 0,
                "d": 0,
                "c": 0
            }
        ],
        "author": {
            "login": "<some user>"
        }
    }
]
Max Powers
  • 1,119
  • 4
  • 23
  • 54
  • 1
    Looks like that is a [limitation](https://stackoverflow.com/a/18190375/2915738) from GitHub side – Asif Kamran Malick May 27 '21 at 10:44
  • Thanks hopefully there is a way to do this weather through multiple looks up or something. – Max Powers May 27 '21 at 14:41
  • I found this TS script on Vitest project to fetch all contributors even when higher than 100, it hint: it calls the API multiple time. It might be useful for some of you, https://github.com/vitest-dev/vitest/blob/main/scripts/update-contributors.ts – ghiscoding Jul 21 '22 at 19:10

0 Answers0