This is the permanent addition of WikiProject data to the pageview API
User wants top pages for WikiProject:Medicine.
This explains the non-adhoc version of how to achieve counts:
Add WikiProject:Medicine as a project modifier to en.wikipedia.org queries on the pageview API. Need to think this through and how it would work on projects like commons and wikidata, but basically queries could ask for /en.wikipedia.org|WikiProject:Medicine/ and get top(1000) and per-project totals. We can get data for other languages by using Wikidata inter-language links. We can assume enwiki is authoritative for this purpose, even though it's not strictly true and we'll miss some articles with this assumption. It's better than nothing and we can improve the assumption when we have better data.
FYI, on English Wikipedia at least, it is possible to query what pages belong to a WikiProject via the PageAssessments API (or directly from the page_assessments table in the enwiki database). For example, to get all the pages that belong to WikiProject Medicine:
This should be faster and more accurate than trying to use category membership or template links. Eventually this will be deployed on other wikis as well.
More info at https://www.mediawiki.org/wiki/Extension:PageAssessments.
This isn't quite resolved, although it may be a moot point now. The new popular page reports use the pageview API for the page view numbers, but still rely on the PageAssessments API for finding out which pages belong to which projects. This bug suggests adding a WikiProject parameter directly into the pageviews API, so that using the PageAssessments API isn't necessary.