To the end of supporting the foundation's larger attribution mission with a reusers oriented proof of concept, we need to add a reference counter in our APIs. We've built a reference parser into structured contents endpoint, it can come from there. There is also an x tools counter of references. X tools is the API we must investigate for the following ticket - https://phabricator.wikimedia.org/T381439
Xtools looks for elements with [typeof~="mw:Extension/ref"] in the annotated output of the REST API page/html endpoint. creating an exact count of <ref> attributes.
[] https://github.com/x-tools/xtools/blob/84a7b2f79cb9cbb0fb3c203903eab77990704012/src/Model/PageInfoApi.php#L178
We should go forth with the fastest, more reliable option.
To Do -
[] Document the decision to use xtools or build counter internally
[] discuss and decide with Francisco & Stephanie
[] Add Reference counter in structured contents endpoint