Questions tagged [mediawiki-api]

The MediaWiki API is the interface for automated editing processes ("bots") and other programs to access data in a MediaWiki wiki.

Documentation for the API is available at mediawiki.org; a summary of all available parameters and short help is available by accessing the API endpoint on the wiki, e.g. here for the English .

Please make sure to check out the Etiquette page to get acquainted with the best practices and usage guidelines for using the API.

629 questions
3
votes
0 answers

Simplest way to login by BotPasswords and get HTML page-contents

I need to use wget or curl by terminal... And ideally in one step. My Wiki need standard login (default Mediawiki v1.33 installation), and I used the page Especial:BotPasswords to create myUserName@myBotName = etc123etc So, how to use this…
Peter Krauss
  • 13,174
  • 24
  • 167
  • 304
3
votes
2 answers

Use pywikibot to download complete list of pages from a Mediawiki server without iterating through pages

I have a large (50K+ pages) Mediawiki wiki, and I need to efficiently get a list of all pages, sorted by last update time. I'm working in Python using pywikibot. The documentation hints that this is possible, but I haven't decoded how to do it…
Mark Olson
  • 136
  • 2
  • 9
3
votes
1 answer

How do I iterate over an array in a nested data structure?

I am attempting to parse over the MediaWiki's API output with format=yaml. My YAML code looks something like: use YAML qw(Dump Bless Load); use YAML::LoadURI; use YAML::Tag; my $yaml_hash = LoadURI($wiki_url); my $id =…
kSiR
  • 774
  • 4
  • 9
3
votes
1 answer

How to search entities by instance in Wikidata API

I tried without success get this query: https://www.wikidata.org/w/api.php?action=wbsearchentities&search=arturo&format=json&language=en&uselang=en&type=item but only with elements from instance "human of", that means from P31 : Q5 Any help will be…
Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116
3
votes
1 answer

MediaWiki API - what are the differences between 'opensearch' & 'query', and 'generator' & 'list' in the API call url

I'm trying to work with the mediawiki API for a project on FreeCodeCamp. I've read through these pages on the API docs: OpenSearch Generators Lists Query And it's still not clear what the real differences are, and when and why I'd need to use…
firefiber
  • 155
  • 1
  • 2
  • 10
3
votes
3 answers

How to parse Wikipedia XML with PHP?

How to parse Wikipedia XML with PHP? I tried it with simplepie, but I got nothing. Here is a link which I want to get its…
yuli chika
  • 9,053
  • 20
  • 75
  • 122
3
votes
2 answers

Wiki that can be integrated into a web-application

I've been thinking about integrating a wiki into my web-application. Currently I'm testing MediaWiki API (web-services interface), but my intended usage will most likely conflict with the GPL license. Some parts of my web-application is closed…
hishadow
  • 1,145
  • 7
  • 9
3
votes
2 answers

How to retrieve history version of Wikipedia article by given date?

Is there a way to use MediaWiki API or any other tool to automatically retrieve a previous version of a Wikipedia article using an approximate date (without knowing the 'oldid' value)? For example how can I retrieve the history version of Stack…
godidier
  • 923
  • 16
  • 34
3
votes
3 answers

Wiki-distance: distance between Wiki topics and categories?

Is there something a [directional?] notion/implementation of distance between Wikipedia categories/pages? For example consider: A) "Saint Louis University" B) "university" Clearly "A" is a type of "B". How can you extract this from Wiki? If you…
Daniel
  • 5,839
  • 9
  • 46
  • 85
3
votes
2 answers

What do the parameters in Wikipedia API response mean?

When calling the Wikipedia API, what do the keys in the links objects mean? I'm guessing ns stands for namespace, but why is it an integer? Why is exists empty for every object? Why is what appears to be the page name title key called *? For…
kal
  • 160
  • 8
3
votes
1 answer

Find all pages that redirect to the existing/instanciated Wikipedia page

Given a page in wikipedia, how to find/retrieve (using either Wikipedia or Wikimedia) all the name of the pages that will redirect to this page ?
dtrckd
  • 657
  • 7
  • 17
3
votes
2 answers

How to extract all reference data from a Wikipedia page?

Given any page on Wikipedia, such as the one for Coffee, I'm trying to figure out how to extract a list of all references (including any metadata) on the page. At first glance it seems this would be easy, since most pages list them all under a…
mix
  • 6,943
  • 15
  • 61
  • 90
3
votes
2 answers

How to read MediaWiki API JSON response

I am trying to search images on Wikimedia Commons, using MediaWiki API. Here is my requested URL with search params: https://commons.wikimedia.org/w/api.php?action=query&list=allimages&format=json&aifrom=Dada I am succeed to get response in JSON…
Damjan Pavlica
  • 31,277
  • 10
  • 71
  • 76
3
votes
3 answers

No 'Access-Control-Allow-Origin' header is present. Origin is therefore not allowed access

EDIT: No JSONP! Yes i know CORS is handled by the server and Yes the server does support it. The issue is on my side. I am trying to use MediaWiki API from the browser. I am sending a GET request through XMLHttpRequest but due to CORS issues it's…
Sneb
  • 151
  • 3
  • 8
3
votes
1 answer

OS X CPAN Perl module installation issue

I'm trying to install Perl module MediaWiki::API using CPAN on OS X: sudo cpan MediaWiki::API Password: Reading '/Users/qazwsx/.cpan/Metadata' Database was generated on Mon, 13 Jul 2015…
qazwsx
  • 25,536
  • 30
  • 72
  • 106