Questions tagged [wikipedia-api]

Related to the use of the MediaWiki API on Wikipedia. Consider also the tags [wikipedia] if your question isn't about the API or [mediawiki-api] if your question isn't about Wikipedia.

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.

In addition, there is a REST API that allows fetching commonly used data in a simple format. A list of all endpoints can be found in the REST API Documentation.

Please make sure to read the etiquette for best practices for using the API and general usage guidelines.

1085 questions
7
votes
2 answers

how can one find categories of a wikipedia page using just links of pages?

Is there any API by which one can get all the categories of a page using the title or page id or url of that page? I tried searching on net but all I could find was getting dumps for specific categories. Any sort of help will be highly…
user1276381
  • 319
  • 1
  • 4
  • 11
7
votes
1 answer

Setting "an informative User-Agent string" in getURL

I am trying to access a Wikipedia page so to get a list of pages, and get the following error: library(RCurl) u <- "http://en.wikipedia.org/w/index.php?title=Special%3APrefixIndex&prefix=tal&namespace=4" getURL(u) [1] "Scripts should use an…
Tal Galili
  • 24,605
  • 44
  • 129
  • 187
7
votes
1 answer

Get total number of articles from a MediaWiki wiki programmatically

How can I get the total number of articles using the MediaWiki API? I couldn't find it in the docs: http://www.mediawiki.org/wiki/API:Search http://en.wikipedia.org/wiki/Help:Searching#Search_engine_features Even a rough approximation is fine.
Mulone
  • 3,603
  • 9
  • 47
  • 69
7
votes
1 answer

pass session cookies in http header with python urllib2?

I'm trying to write a simple script to log into Wikipedia and perform some actions on my user page, using the Mediawiki api. However, I never seem to get past the first login request (from this page:…
Ricardo Altamirano
  • 14,650
  • 21
  • 72
  • 105
7
votes
1 answer

How to get HTML content text of a Wikipedia Page (via Wikipedia API)?

i just want to get content (no link, no categories, no images...just text)
Leonardo
  • 2,273
  • 6
  • 29
  • 32
7
votes
5 answers

Using Wikipedia's API to fetch results from search query

I am trying to use Wikipedia's API to make a search query, then append those results to my page. This is what I have so far : "use strict"; $(document).ready(function(){ function searchWikipedia(searchCriteria){ …
victoria
  • 197
  • 1
  • 1
  • 12
7
votes
2 answers

Parsing Wikipedia countries, regions, cities

Is it possible to get a list of all Wikipedia countries, regions and cities with relations between them? I couldn't find any API appropriate for this task. What is be the easiest way to parse all the information I need? PS: I know, that there are…
7
votes
3 answers

Convert from wiki to html

I'm using a wikipedia api for getting info from wikipedia. Is there anything for convert wiki text in html? I've tried mediacloth but i doesn't works well
Luca Romagnoli
  • 12,145
  • 30
  • 95
  • 157
7
votes
1 answer

How can I make the Wikipedia API normalize and redirect without knowing the exact case of all characters?

If I try to get the language links for a page on Wikipedia via their API like this: http://en.wikipedia.org/w/api.php?action=query&prop=langlinks&format=json&lllimit=10&llurl=&titles=wreck-it%20Ralph&redirects= I get a list of results. But if I…
Peter Jaric
  • 5,162
  • 3
  • 30
  • 42
7
votes
1 answer

Finding and downloading images within the Wikipedia Dump

I'm trying to find a comprehensive list of all images on wikipedia, which I can then filter down to the public domain ones. I've downloaded the SQL dumps from here: http://dumps.wikimedia.org/enwiki/latest/ And studied the DB…
Keith Schacht
  • 1,998
  • 15
  • 23
7
votes
2 answers

Why does full-text search inside titles return error

When I perform full-text search with Wikipedia API, I can not narrow it to titles only (srwhat=title). So while search anywhere (default) http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=sql&srnamespace=14&format=xml returns…
Maksee
  • 2,311
  • 2
  • 24
  • 34
7
votes
2 answers

Download images with MediaWiki API?

Is it possible to download images from Wikipedia with MediaWiki API?
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
7
votes
3 answers

MediaWiki URL parameters without values

The query part of a URL seems to consist of key-value pairs separated by & and associated by =. I've taken to always using jQuery's $.param() function to URL-encode my query strings because I find it makes my code more readable and maintainable. In…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
6
votes
1 answer

Getting Wikipedia infobox content with JQuery

I'm looking to use JQuery to pull back contents of the Wikipedia infobox that contains company details. I think that I'm almost there but I just can't get the last step of the way var searchTerm="toyota"; var…
Eric T
  • 220
  • 1
  • 4
  • 10
6
votes
1 answer

Wikipedia API - Accessing JSON Object

I'm trying to pull the text out of a Wikipedia article using their API (API is a generous term for what they are offering, but we'll use it I guess), and I am running into issues regarding parsing of the subsequent JSON object I am getting back.…