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 Sandbox - get all translation alternatives

I wish to retrive with wikimedia api (here it is the Sandbox) all translation versions of a page. As an example, in this page https://en.wikipedia.org/wiki/Category:1935_births I need to retrive all links that are on the left sidebar after the…
Luca
  • 848
  • 1
  • 14
  • 33
3
votes
2 answers

How to delete all pages from a certain category

Is there a possibility or a special page, that provides following use case: I have several pages > 10 < 100 in a category Instead of separate page delete, it would be convenient to delete all pages in that category.
cinhtau
  • 1,002
  • 8
  • 16
3
votes
1 answer

Extract number of video or audio files from Wikipedia article

I'm trying to extract the number of videos or audio files present in a Wikipedia article, I searched the APIs but didn't find one for that. I did notice that when using the API to extract the images for a specific page, the audio file with .ogg…
Afnan Ahmad
  • 163
  • 5
3
votes
2 answers

Get Wikipedia math expressions using MediaWiki API

I want to get the content of tags in the API response MediaWiki. I've tried to use this query: https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=xml&titles=delta-v And I'm getting valid xml file, but in place of I'm…
TigerInALoop
  • 225
  • 1
  • 2
  • 8
3
votes
1 answer

Access copyright info on Wikimedia Commons via api

I would like to use the MediaWiki API to get the copyright info for an image. When you click on an image in Wikipedia, the page with the image is opened containing a button "more details". Clicking this button you come to a page which contains a…
Gerhard
  • 1,342
  • 2
  • 12
  • 23
3
votes
1 answer

MediaWiki return best match to query string

I want to essentially build my own search bar into wikipedia's api. Given a string entered by a user, it should return the first section from the wikipedia page that best matches that search string. It works perfectly if the title entered is…
Timo Loescher
  • 119
  • 1
  • 1
  • 16
3
votes
1 answer

Wikipedia Api get amounts of words

I'm a bit stuck in all the options the Wikipedia api has. My goals is to get the amount of words of an wikipedia page. I have the url of the wiki. The search option does return this…
NLAnaconda
  • 1,534
  • 3
  • 14
  • 38
3
votes
2 answers

Bad or Invalid Token in Extension with Mediawiki API

I'm trying to make a simple extension that moves a page on my mediawiki site, but whether using curl or FauxRequest, I always get bad token response. Tried urlencoding, not encoding, escaping, without +/, etc, doesn't matter. Code looks like this…
Justin M
  • 103
  • 1
  • 8
3
votes
1 answer

Do lower MediaWiki page revision IDs always mean earlier edits?

In general it seems true, at least for a single page, that lower revision IDs for Mediawiki page histories mean an earlier edit time. Is this true in General? Are there ever exceptions? How does revision ID minting work? I am trying attempting…
notconfusing
  • 2,556
  • 3
  • 22
  • 26
3
votes
2 answers

List all Wikipedia articles in one category and subcategories

Is there any way to get a list of all Wikipedia articles in one category, including all subcategories? I tried to extract the links from the category page with a PHP script, but it seems like there is no possibility to get all articles including…
user3260254
  • 37
  • 1
  • 3
3
votes
3 answers

PHP connecting to MediaWiki API and retrieve data

I noticed there was a question somewhat similar to mine, only with c#:link text. Let me explain: I'm very new to the whole web-services implementation and so I'm experiencing some difficulty understanding (especially due to the vague MediaWiki API…
Gal
  • 23,122
  • 32
  • 97
  • 118
3
votes
2 answers

How to get all links(id) of specific page in wikipedia by pageid

I`m trying to build query with Wiki API that will return all internal links from specific article in id format. I have pageId of some article. For example for article "Android (Operational System)" id is 12610483. In my client side i need to work…
Yonatan Levin
  • 342
  • 5
  • 17
3
votes
1 answer

Determing the namespace in a mediawiki page (api quest.)

For starters I must admit my PHP skills are pathetic (been doing this for 3 days) I have during the last three days heavily modified an extension which parses pages just edited in mediawiki. The original purpose was to parse the page for text…
Jase
  • 519
  • 1
  • 9
  • 23
3
votes
2 answers

Wikipedia API: Excluding References From Parse Request

I'm trying to get the links from a particular page in order as presented on page, or reasonably close. I believe I found the correct API call to do so using the parse request, however I'm noticing that I'm getting alot of what I consider "junk"…
Nobosi
  • 1,066
  • 6
  • 14
3
votes
1 answer

Mediawiki API error: Unrecognized value for parameter 'prop': extracts

I have a new installation of mediawiki. I am trying to use the API to simply get an article. The API url I am using is: https://example.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor_cisco Upon going to that URL I get:…
user985723
  • 628
  • 2
  • 8
  • 18