MediaWiki provides a WikiPage::getContributors() method, but it uses a complex SQL query and it may not perform well especally under higher load.
We should check if we can use that method for the attribution endpoint, and if not, then we should look into a different way of retreving contributors count.