Questions tagged [wikipedia-api]

If your inquiry does not pertain to the Wikipedia API, you may find the [wikipedia] tags relevant. Additionally, if your question is unrelated to Wikipedia, feel free to utilize the [mediawiki-api] tags.

Get a URL from the JSON data returned by the Wikipedia API

How can I retrieve the image URL from a JSON response and store it in a variable? I found helpful information on the MediaWiki API help page Following this example to extract image information from a page: https://commons.wikimedia.org/w/api.php?action= ...

Accessing Data from the Wikipedia API

After receiving a JSON response with the following structure: { "batchcomplete": "", "query": { "pages": { "97646": { "pageid": 97646, "ns": 0, "title": "Die Hard", "extract": "Die Hard is a 1988 ...

Fetching a Wikipedia page using AJAX or the fetch() method

I am currently attempting to dynamically retrieve a Wikipedia webpage within the browser in order to utilize XSLTProcessor for further processing of the XHTML content. Unfortunately, my efforts have been unsuccessful as Wikipedia is not sending the necess ...

Python OSError: [Errno 9] Issue with file descriptor encountered upon attempting to open large JSON file

Recently, I attempted to process a large json file (the Wikipedia json dump) in Python by reading it line by line. However, I encountered the following Error: Traceback (most recent call last): File "C:/.../test_json_wiki_file.py", line 19, in ...

Extracting information from wikiarticle JSON. Unexpected JSON output

When parsing all sections of a wikiarticle, everything usually goes smoothly. However, I've encountered a specific issue that I can't seem to troubleshoot: Requesting restpoint 1 works perfectly and gives me the section structured as JSON: http ...

GSON - Decoding JSON Obtained through Wikipedia API with Dynamic Object Naming

{ "batchcomplete": "uniqueText123", "continue": { "grncontinue": "0.262157292819|0.262157407383|17998004|0", "continue": "grncontinue||" }, "query": { "pages": { "54321098": { "pageid": 54321098, "ns": 1, ...

Unable to communicate with MediaWiki API using jQuery

My attempt to retrieve content from Wikipedia in JSON format has been unsuccessful: $.getJSON("http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles="+title+"&format=json", function(data) { doSomethingWith ...

The Wikipedia application programming interface (API) was unable to locate a particular web page (URL containing an apostrophe)

While I am able to retrieve pageviews info for other pages, I'm encountering an error when trying to fetch data from a particular page. The error message reads: File "<unknown>", line 1 article =='L'amica_geniale_ (serie_di_romanzi ...