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

How to use special characters in Wikipedia API?

If you query the wikipedia api for c# with a url such as: https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&titles=c%23 The response removes the %23 / # and turns it into just C, and displays results for C…
mariocatch
  • 8,305
  • 8
  • 50
  • 71
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
1 answer

Get random Wikipedia extract with Ajax

I'm trying to get the extract of a random Wikipedia page using Ajax. I've got as far as getting the data, but I'm having trouble outputting it. Here's my code: $.ajax({ type: "GET", url:…
Sebastian
  • 3,548
  • 18
  • 60
  • 95
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
1 answer

Dbpedia/sparql: get population & lat/lng of all cities/towns/villages in UK

I'm entering the following query at http://dbpedia.org/sparql: PREFIX geo: SELECT ?s ?name ?value ?lat ?lng WHERE { ?s a . ?s…
EoghanM
  • 25,161
  • 23
  • 90
  • 123
3
votes
1 answer

How to extract human-readable data using Wiki-data toolkit api?

I am using wikidata to fetch data for research. My goal is for each given name, e.g. Abdias Praetorius, get the entity's id, dob, place of birth, sex etc . The page is : https://www.wikidata.org/wiki/Q308161 And it seems easy. But when I used…
Bo Yuan
  • 107
  • 1
  • 12
3
votes
1 answer

What is the difference between DBPedia and Wikipedia data?

May I define (or calculate) the difference between DBPedia and Wikipedia data concerning, for example, Ecuadorian People? Does DBpedia contain the same Ecuadorian People existing in Wikipedia? If not - what is the difference (e.g. how to extract…
GML-VS
  • 1,101
  • 1
  • 9
  • 34
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 map between Freebase and Wikipedia?

I used the tool AIDA (a kind of named entity tool) to annotate a corpus and get the format like this: 2 Germany http://en.wikipedia.org/wiki/Germany 11867 /m/0345h 6 United_Kingdom http://en.wikipedia.org/wiki/United_Kingdom 31717 …
hidemyname
  • 3,791
  • 7
  • 27
  • 41
3
votes
2 answers

Get Wikipedia pageid from title

I'm trying to get an image from a Wikipedia article. I have the title of the article but it seems like I need to know the pageid to access the thumbnail. How do I get the pageid from the title? My JavaScript…
Benck
  • 515
  • 1
  • 5
  • 17
3
votes
1 answer

Wikipedia API get links to all images of preferred redirected articles in one API call?

I want to get the links to all the images for the default redirect pages for, say, "Hypertensive Disease" and "pulmonary edema." Right now, I am doing this through three api calls for each term. E.g,…
law826
  • 43
  • 6
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

Find main category for article using Wikipedia API

I have a list of articles and I want to find the main category of each article. Wikipedia lists its main categories here - http://en.wikipedia.org/wiki/Portal:Contents/Categories. I am able to find the subcategories of each article…
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