discrepancy for number of contributors between v3 API and repo web page

Hi,

On the GitHub page for TensorFlow:
          https://github.com/tensorflow/tensorflow
there are 1,190 contributors.

However, when I used the v3 API to get all contributors via pagination, the Link headers are like:

{
    ‘rel’: ‘next’,
    ‘url’: ‘https://api.github.com/repositories/45717250/contributors?per_page=100&page=2
}
{
    ‘rel’: ‘last’,
    ‘url’: ‘https://api.github.com/repositories/45717250/contributors?per_page=100&page=5
}

There are 100 contributors on the first 4 pages and 16 on the 5-th page so altogether there are
    4 * 100 + 16 = 416
contributors. Why is there such discrepancy?

Thanks for reading.

In the documentation for the API you’re using it states:

To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.

What you’re missing is that some of those first 500 email addresses might not be associated with any GitHub user, so there’s considered anonymous. Which means you need to use the anon=1 flag and that will give you more results:

https://api.github.com/repositories/45717250/contributors?per_page=100&page=6&anon=1

I hope that helps!