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
1 answer

MediaWiki API query for images for multiple titles

When I ask the MediaWiki API to provide images for each title, it just returns images for the first specified title. For example, the…
sadensmol
  • 93
  • 1
  • 7
3
votes
1 answer

How do I log into mediawiki using PHP cURL?

I'm trying to integrate mediawiki into my website, but I'm having trouble. I think the problem has something to do with the cookies because I get a success from the mediawiki API. Here's my code: function mw_session_manager($Action = "") { $Root…
Adam11
  • 493
  • 3
  • 12
3
votes
0 answers

wikipedia api results vary between list and generator queries

I'm exploring wiki apis... Based on the below post, i 've some doubts. Wikipedia list=search REST API: how to retrieve also Url of matching articles I need to fetch the wiki URLs for my search. So I used generator=search instead of list=search But…
deeshank
  • 4,286
  • 4
  • 26
  • 32
3
votes
3 answers

How to get Wikipedia page HTML with absolute URLs using the API?

I'm trying to retrieve articles through wikipedia API using this code $url = 'http://en.wikipedia.org/w/api.php?action=parse&page=example&format=json&prop=text'; $ch = curl_init($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $c =…
3
votes
1 answer

How to search for text in page title and content with MediaWiki API?

I'm not sure if it is actually possible to do, because I can only find out how to search titles like this: /api.php?action=query&rvlimit=10&rvprop=content&format=xml&titles=searchterm
Gil Julio
  • 812
  • 1
  • 9
  • 18
2
votes
2 answers

API for loading pictures of public figures?

I'm working on a PHP project where I create a more readable version of a text transcript for a judicial inquiry, and one thing I'd really like to do is have photos depicting each speaker. Some of them are public figures (I.e., well-known UK judges…
aendra
  • 5,286
  • 3
  • 38
  • 57
2
votes
2 answers

Is there an API for WikiTravel?

Is there an API for WikiTravel data? Is it same as the MediaWiki Api? if any one knows any tutorial or "how to" documentation please let me know.
dinesh707
  • 12,106
  • 22
  • 84
  • 134
2
votes
2 answers

Specifying offset in MediaWiki search

I'm querying a MediaWiki instance which we are running. I'm passing the following parameters for the search api.php?action=opensearch&search=afg&limit=100&format=xml I didn't see any way to pass the offset as a parameter. Does anybody know how we…
allthenutsandbolts
  • 1,513
  • 1
  • 13
  • 34
2
votes
1 answer

How to get the result of "all pages with prefix" using Wikipedia api?

I wish to use Wikipedia api to extract the result of this page: http://en.wikipedia.org/wiki/Special:PrefixIndex When searching "something" on it, for example…
Tal Galili
  • 24,605
  • 44
  • 129
  • 187
2
votes
0 answers

Bulk convert Media Wiki pages to HTML (either via API or locally from saved wikitext)

I'm trying to get the actual HTML of about 600-700 pages hosted on a Media Wiki. I have thought of/tried the following: Option 1 Action API with action=parse: works well, takes about 0.75 seconds per page. I haven't been able to do this for multiple…
Ash
  • 134
  • 1
  • 6
2
votes
1 answer

MediaWiki API: size at which images where embedded/dropping unrelated icons

I use the MediaWiki API to find images of Wikipedia articles. However, I also get all the useless icons, like the broom for when a article needs to be cleaned up or the creative commons logo that marks something to be placed under a creative commons…
panzi
  • 7,517
  • 5
  • 42
  • 54
2
votes
1 answer

Get random SVG image using MediaWiki API

Is it possible to use the MediaWiki API to return a random image? If so can I specify a filetype such as SVG?
Tim
  • 71
  • 1
  • 7
2
votes
1 answer

How to list all properties on a custom Wikibase instance

I am trying to list all properties created in on a wikibase I installed, using docker-compose, based on this install. Now, want to list all properties that are available in this wikibase, similar to getting that list available…
Andra
  • 687
  • 2
  • 9
  • 20
2
votes
1 answer

How to get all archived talk pages of a wikipedia page?

I am using the following code to fetch talk page for a given Wikipedia page. import pywikibot as pw page = pw.Page(pw.Site('en'), 'Elon_Musk') talkpage = page.toggleTalkPage() talkpage.text This works fine, but it does not return all archived talk…
SanMelkote
  • 228
  • 2
  • 12
2
votes
1 answer

How to fix "readapidenied" error on mediawiki-api in Java

I'm working on a project which use the mediawiki API and I have this error : error code=readapidenied info:'You need read permission to use this module.' INFOS: Could not retrieve Mediawiki Version via API - will assume Mediawiki 1.27 or before…
Wivu
  • 71
  • 8