Search code examples
gitrestgithubgithub-api

I need to gather review statistics from GitHub on our project


I need to extract information from our private GitHub repo regarding the number of reviews each of our collaborators are doing during a set time period.

I've been reviewing the GitHub documentation but it's not obvious to me if it's even possible using their REST API.

I want to use the data to present the information in a graph online automatically, so REST is the prefered way.

Does anyone know if it's even possible?

Thanks, /J


Solution

  • Here is a link to the list reviews on a pull request endpoint. The call will return user details so you can tally the volume of reviews and who performed them. Here is an example of the call:

    curl -u <USER>:<API_KEY> https://api.github.com/repos/<owner>/<repo>/pulls/<number>/reviews

    You can automate this further be generating a list of your organization's repositories, then pulling a list of the pull requests in each repository. The JSON payload of pull requests will include the id you'll need for generating the pull request review information.