Jump to content

API talk:Exturlusage

From mediawiki.org
Revision as of 20:09, 17 December 2024 by Flow talk page manager (talk | contribs) (Flow talk page manager moved page API talk:Exturlusage to API talk:Exturlusage/Flow without leaving a redirect: Flow archival)

Latest comment: 1 year ago by OlafJanssen in topic API on Dutch Wikipedia does not seem to work

Usage of eucontinue

Hello! I would like to get the number of links to a specific domain on Wikipedia (in my particular case the links to institutional repositories on different versions of wikipedia). This work perfectly fine as long as the number of links doesn't exceed 500.

I have seen the `eucontinue` parameter in the documentation but I couldn't figure out how to use it in an (iterative) API request.

Could anybody provide an example (maybe based on `get_exturlusage.py`) of how to use the eucontinue parameter?

Thank you! Aw8988 (talk) 04:45, 29 April 2021 (UTC)Reply

The example in API:Exturlusage#Response returns a "continue" property, which in turn contains "eucontinue" and "continue". You should append/merge both on the next request to continue pagination, until you no longer get a "continue" property in the response. Ciencia Al Poder (talk) 08:07, 29 April 2021 (UTC)Reply

API on Dutch Wikipedia does not seem to work

The call https://nl.wikipedia.org/w/api.php?action=query&list=exturlusage&eulimit=100&eunamespace=0&format=json&euquery=https://www.dbnl.org gives zero results, while the Dutch article https://nl.wikipedia.org/w/index.php?title=Theodoor%20van%20Ryswyck&action=edit clearly contains the URL "https://www.dbnl.org"

The equivalent call in the WPNL frontend seems to work: https://nl.wikipedia.org/wiki/Speciaal:VerwijzingenZoeken?target=https%3A%2F%2Fwww.dbnl.org

A modified call with a variant value of "euquery" does seem to work : https://nl.wikipedia.org/w/api.php?action=query&list=exturlusage&eulimit=100&eunamespace=0&format=json&euquery=dbnl.nl OlafJanssen (talk) 12:17, 21 November 2024 (UTC)Reply

Self-solved this issue: apparently you need to specify the "euprotocol=https" explicitly
https://nl.wikipedia.org/w/api.php?action=query&list=exturlusage&eulimit=100&eunamespace=0&format=json&euprotocol=https&euquery=www.dbnl.org
However, this is not stated correctly in the documentation : "If empty and euquery is set, the protocol is http and https"
https://nl.wikipedia.org/w/api.php?action=query&list=exturlusage&eulimit=100&eunamespace=0&format=json&euprotocol=&euquery=www.dbnl.org gives 0 results OlafJanssen (talk) 12:29, 21 November 2024 (UTC)Reply