Jump to content

Manual talk:Pywikibot/Create your own script

Add topic
From mediawiki.org

Any way to make an API request easily?

[edit]

Hi, I know there is a pywikibot.data.api module, but could not figure out yet how to use it... Do you have any tip on making an API request to a Wikimedia site? (Looks like the Request class in the data.api module could be used—but how?) Automatik (talk) 19:23, 31 August 2018 (UTC)Reply

I've created phab:P7506. Framawiki (talk) 09:24, 1 September 2018 (UTC)Reply
Excellent! Thanks Automatik (talk) 20:02, 1 September 2018 (UTC)Reply
pywikibot as multiple tier Levels. Try to get the information from Page or Site object first instead of using the low level api. All the api calls in pywikibot are made by Site objects (with few exceptions I guess)  @xqt 10:14, 4 September 2018 (UTC)Reply
Thanks as well; this solution works also well in a similar manner-the difference is that one has to browse site.py instead of browsing xx.yyy.org/w/api.php Automatik (talk) 15:06, 4 September 2018 (UTC)Reply