Link Count tool also counts template wiki links
Hi BrandonXLF,
I've been using your Link Count tool for some years now and it has been proven to be instrumental for my activities here. I use it in my software to resolve a biography article's 'notability'. However, there's one issue that interferes with that: the tool also counts wiki links stated in a template in an article as incoming links to that article. Example: Kudrat Singh: [the link count] = 680! Reason: the template in the article accounts for almost all the links making Kudrat much more important in my app than he actually is. Is this a feature or a bug? And if the latter: can/will it be fixed? Cheers, Mill 1 (talk) 08:35, 15 October 2023 (UTC)
- It's a feature. Use search if you want to get direct links, e.g. linksto:"Kudrat Singh" insource:"Kudrat Singh" or linksto:"Kudrat Singh" insource:/\[\[Kudrat[ _]Singh[\|\]]/. Nardog (talk) 09:01, 15 October 2023 (UTC)
- Thank you for your reply. However, my web application uses the api to resolve the link counts:
https://linkcount.toolforge.org/api/?page=Kudrat_Singh&namespaces=0&project=en.wikipedia.org
- If possible, how should I change the request in order to get the direct links only? Regards, Mill 1 (talk) 09:10, 15 October 2023 (UTC)
- That's not possible with Link Count. "Direct" in Link Count means "not through a redirect", not "not through a transclusion", which is not retrievable without parsing the source page by page. You should try mw:API:Search. Nardog (talk) 09:21, 15 October 2023 (UTC)
- Ah, ok. Thank you Nardog, I'll look into it. Mill 1 (talk) 09:25, 15 October 2023 (UTC)
- For future reference: this mw:API:Search solution works:
https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srnamespace=0&srlimit=1&utf8=1&formatversion=2&srprop=size&srsearch=linksto%3A%22Kudrat+Singh%22+insource%3A%22Kudrat+Singh%22
- Thanks again, Mill 1 (talk) 10:08, 15 October 2023 (UTC)
- That's not possible with Link Count. "Direct" in Link Count means "not through a redirect", not "not through a transclusion", which is not retrievable without parsing the source page by page. You should try mw:API:Search. Nardog (talk) 09:21, 15 October 2023 (UTC)