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

Retrieve first paragraph of Wikipedia article

I've been trying to understand the MediaWiki documentation for the past 2 days and I can't figure out how to retrieve the first paragraph of a Wikipedia article through the MediaWiki API. Could someone point me to the right direction? I am about to…
Russ Ted
  • 87
  • 1
  • 8
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
4 answers

How to get results from the Wikipedia API with PHP?

I'm probably not supposed to use file_get_contents() What should I use? I'd like to keep it simple. Warning: file_get_contents(http://en.wikipedia.org/w/api.php?action=query&titles=Your_Highness&prop=revisions&rvprop=content&rvsection=0): failed to…
Curtis
  • 2,486
  • 5
  • 40
  • 44
2
votes
1 answer

Login and accessing wikipedia API using pywikipedia

I am new to python. I have a task to access wikipedia. For this I am using the client pywikipedia to access mediawiki api. WHen I am running login.py it is asking me password. how will I get the password? has somebody worked on pywikipedia tool? Any…
Shruts_me
  • 843
  • 2
  • 12
  • 24
2
votes
1 answer

How to get the full image comments using the Wikipedia API?

I'm grabbing some image metadata from the Wikipedia API but noticed the text could be truncated. On this…
tommy chheng
  • 9,108
  • 9
  • 55
  • 72
2
votes
1 answer

Wikipedia API Autocomplete with Json

How can I implement it in the jQuery Autocomplete? $("#searchForm input").autocomplete({ source: function (request, response) { $.ajax({ url: "http://en.wikipedia.org/w/api.php", dataType:…
jQuerybeast
  • 14,130
  • 38
  • 118
  • 196
2
votes
2 answers

How to parse Wikipedia API Content Data

I'm finally successful in pulling data using the Wikipedia API, but there's something I really don't understand, and I can't seem to find the answer. I'm using this to query data: var title =…
gjunkie
  • 798
  • 1
  • 14
  • 28
2
votes
1 answer

Wikipedia api search for text sort by relevancy

When I search in wiki UI for stack overflow I get different results from the API. In the UI: https://en.wikipedia.org/w/index.php?search=Stack+Overflow&title=Special%3ASearch&profile=advanced&fulltext=1&ns0=1 In the…
SexyMF
  • 10,657
  • 33
  • 102
  • 206
2
votes
1 answer

How to find the top most viewed wikipedia pages from today's date using pageviewapi in python

I'm working on a project that needs to find the top wikipedia pages from today, and it uses the code found on the GitHub for pageviewapi, except it substitutes in today's date. The original code on the GitHub is this: import…
George
  • 31
  • 5
2
votes
1 answer

Extract story plots from Wikipedia

Goal I want to extract story plots from the English Wikipedia. I'm only looking for a few (~100) and the source of the plots doesn't matter, e.g. novels, video games, etc. I briefly tried a few things that didn't work, and need some clarification on…
2
votes
1 answer

Querying page and Scraping it using Sheets

I wanna use Sheets to query pages from wikidata and scrape a specific section but I couldn't find anything focused specifically on this, and since I'm a beginner in this I don't know really where to start from. So, I have a list of Q identifiers and…
2
votes
3 answers

Get neat content from Wiki page. (MediaWiki API)

I want to get a content page from Wiki in this format (the picture below) then show it in WebView. It means the content includes text and links. I tried this but the output seems to be…
emeraldhieu
  • 9,380
  • 19
  • 81
  • 139