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

parsing wikipedia stopwords html with nltk

Related to this question, I am working on a program to extract the introduction of wikipedia entities. As you can read in the above link, I already succeeded to query the api and am now focussing on the processing of the xml returned by the api…
Milla Well
  • 3,193
  • 3
  • 35
  • 50
0
votes
2 answers

Get first paragraph of article from Wikipedia

What is the proper way to get a first paragraph of the article for the word Hollywood from Wikipedia? As result, the $result variable contains the first paragraph of the page Hollywood is a district in Los Angeles, California, United States…
Haradzieniec
  • 9,086
  • 31
  • 117
  • 212
0
votes
1 answer

Simplexml_load_file empty array

I try to load this document: $url = "http://en.wikipedia.org/w/api.php?action=query&titles=Electrophoresis&prop=langlinks&lllimit=500"; When I run it in browser, everything is fine. When I do this: ini_set('user_agent', 'XX123456789 (localhost;…
Wistar
  • 3,770
  • 4
  • 45
  • 70
0
votes
1 answer

Wikipedia API ignore Cite Error or Footnotes

I am making this request: http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=self-administration&prop=revisions&rvprop=content&rvparse=&rvsection=0 My goal is to get the plain-text from the intro of an article. It gives me back some…
Wistar
  • 3,770
  • 4
  • 45
  • 70
0
votes
1 answer

Is there a way to access Wikipedia tree for disambiguation pages and categories?

1) for example try visiting : http://en.wikipedia.org/wiki/Architecture_(disambiguation) -->Is there any wikipedia api via which I can access this? 2) for example try visiting : http://en.wikipedia.org/wiki/Architecture When you do right at the…
user1609626
0
votes
1 answer

Wikipedia Search API

I am trying to code a Wikipedia search and return script. What I am trying to achieve is when a user enters a search query in my text box, it searches Wikipedia for that query and returns the result. very simple. I am having problems using Wikipedia…
James
  • 61
  • 1
  • 7
0
votes
1 answer

How to get wikipedia categories on Android application

I make the Android Application now. I want to implement the method as below: judge if there is an article of "key word" if there is, return categories. if there is not or a category is "Disambiguation pages", return null. For example, if key…
Benben
  • 1,355
  • 5
  • 18
  • 31
0
votes
1 answer

wikipedia API to get a particular search text in text format

I want to grep all the content of the "United States of America" to a text file without images. I am looking a response in text format. How can I do that? I got this url constructed:…
The Learner
  • 3,867
  • 14
  • 40
  • 50
0
votes
1 answer

What is the 'mywikiLoggedOut=12345678' cookie good for?

While logging in via the API, I get back some cookies from the Wikimedia framework: mywikiUserName=myusername; mywiki_session=a27c625a1babc58ad7cc11e317c9eed2; mywikiLoggedOut=20120723255540"; I wonder what the mywikiLoggedOut=20120723211540…
brainray
  • 12,512
  • 11
  • 67
  • 116
0
votes
1 answer

What is the reason for the error "Failed to decode JSON" in MediaWiki::API?

We have private MediaWiki installation inside our company. Based on daily builds on our source code, we update the wiki with Perforce labels so that people can use the build that is labeled for streamlined process. We tried to automate this using…
bicepjai
  • 1,615
  • 3
  • 17
  • 35
0
votes
2 answers

Wikipedia People API

I want to use wikipedia API to list the peoples whose birthday is on particular date. Anybody has used it before? Please advice me in right direction.
PGU
  • 495
  • 6
  • 21
0
votes
1 answer

How to add 'http:' to img src to get correct image url in javascript

I have a javascript widget which fetches articles from Wikipedia through MediaWiki API (http://en.wikipedia.org/w/index.php?title=Main_Page&action=render). It's an app for Samsung Smart TVs. Now the text part works fine, but it won't display any…
GeorgeSh
  • 3
  • 1
0
votes
1 answer

Getting links to wikipedia images

I'm trying to extract the links to all the images in the wikipedia, without losing the image names and probably the alt tags. I got to know from How do I get link to an image on wikipedia from the infobox? that I could get it by querying:…
madCode
  • 3,733
  • 5
  • 26
  • 31
-1
votes
0 answers

Where and how could find On this day API to get date and facts about events in science, inventions and business?

I know about Wikipedia API or other 'On This day API', but it's wide items. I need information only about events in science, inventions and business and people in these niches. I tried to find them but while without success. While I just Googled it…
Kirill
  • 1
-1
votes
1 answer

Anyone having issues with WikipediaKit? July 2023

I've been using Wikipediakit in my swift/ios app for some time now, it's always worked fine. Suddenly it's stopped (just as I shipped it to the app store, annoyingly), and I'm getting a 'badResponse' error from the API. On the github repo there is a…