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
-1
votes
3 answers

extract an URL from a JSON response of wikipedia api

I need to extract the URL of an image from a JSON response (maybe I could put it in a variable). I read this page on the MediaWiki API help I follow this example to get the information about images on a…
Jeek
  • 39
  • 1
  • 6
-1
votes
1 answer

How do I change a string into valid wikipedia page name?

I want to take a phrase like "banana tree" and send it directly to a wikipedia url like "Banana_tree". I know it has to follow the rules as outlined (https://en.wikipedia.org/wiki/Wikipedia:Page_name). Is there a JavaScript package that…
Rashi Abramson
  • 1,127
  • 8
  • 16
-1
votes
1 answer

How to continue to call Wikipedia API the 500 limit?

I am running the following, and I notice that after 500, it stops, I would like it to run again starting from the next index in order to carry on searching: var a = 0;…
rob.m
  • 9,843
  • 19
  • 73
  • 162
-1
votes
1 answer

how to retrieve author's name from Wikipedia API?

I'm getting a JSON with all the text but what I need is just the key info for this page: https://en.wikipedia.org/wiki/Reddit (author's name, type of site, logo of the publication, etc.) Can I add any props to this string?…
pazza1
  • 11
-1
votes
1 answer

Wikipedia API extract returning Edit Link in Text

I am attempting to pull the json from the wikipedia API. When I extract the main content it shows up on my page but the edit links show up next to the

header. I've included the param "disableeditsection": false, as both true and false but to…

Mr T
  • 3
  • 2
-1
votes
1 answer

how to change language of retrieved content using language api in wikipedia?

I want two api call one for content and the other one for language change.
Darvin Kumar
  • 123
  • 2
  • 8
-1
votes
2 answers

Wikipedia API Hello World not working?

The following simple code isn't working for Wikipedia API. I'm not sure why. html:
h
Script: function doThis() { var wikiUrl =…
Dr Confuse
  • 605
  • 1
  • 7
  • 24
-1
votes
1 answer

Wikipedia API for personal website

If I search any keyword on Google like "Sesame oil" it shows content from wiki at right side. Those details are informative for users. I wanted to know, is there any API provided by WikiPedia which I can use as well? So that if any user search for…
Vijay G
  • 63
  • 9
-1
votes
1 answer

PHP: Unable to echo values from nested Array in PHP

I want to echo data which is in JSON format. I converted from JSON to PHP array using json_decode() but it is not getting echoed. Blow is my code:
avirajkhare00
  • 79
  • 2
  • 11
-1
votes
1 answer

Removing Non English Sub headings and Paragraphs

Hi I have a script which is able to remove subheadings and paragraphs but I am not able to remove paragraphs with non english subheadings and words. For example, (Original Text): === Personal finance === Protection against unforeseen personal…
windboy
  • 141
  • 1
  • 9
-1
votes
4 answers

Uncaught TypeError: Cannot read property 'foo' of undefined

I'm doing a project with the wikipedia media API. I'm querying the API using Jquery. The following request works when checking the developper console in Chrome as seen in this codepen http://codepen.io/jowze/pen/NNZNKY/?editors=1010 $.ajax({ …
jowze
  • 63
  • 1
  • 3
-1
votes
1 answer

Get wikipedia categories title with getJSON

I'm trying to retrieve the title's categories from JSON data. For example: https://fr.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=categories I tried something like this: var requestOnURL =…
teddym
  • 55
  • 1
  • 7
-1
votes
1 answer

How to grab URL from Wikipedia by API?

I have list of company names. What I want to do is, to get their websites by company names. Let's say we want to grab "Website" from Microsoft Wikipedia page. The query below doesn't return this…
heron
  • 3,611
  • 25
  • 80
  • 148
-1
votes
1 answer

Wikipedia Image list show from wikipedia xml api

I am trying to write a code in which I got as xml format for the first image api from wikipedia. Now I want to parse it through c#. But I cannot get the image while running code. here is my code. namespace WikiAPIWinForm { public partial class…
ktina51
  • 25
  • 1
  • 8
-1
votes
1 answer

How to use Wikipedia API to expand entities?

I'm working on my thesis and I encountered a problem i don't know hot to approach properly. I'm clustering tweets and given the few information they carry, I want to expand the entities I find in the text by accesing Wikipedia and taking the…