Questions tagged [wikipedia]

Consider the tags wikipedia-api (or the more general mediawiki-api) and mediawiki. Questions should be related to programming.

Source: Wikipedia

Wikipedia, the free encyclopedia, is a free web-based encyclopedia project written and maintained by people all over the world and is one of the most visited websites in the world(1,2). Consider also the tags,

  • if your question has to do with the use of the API on Wikipedia
  • if your question has to do with the use of the API on general Mediawiki sites
  • if your question has to do with the MediaWiki software.
1766 questions
177
votes
13 answers

Is there a Wikipedia API just for retrieve the content summary?

I need just to retrieve the first paragraph of a Wikipedia page. Content must be HTML formatted, ready to be displayed on my website (so no BBCode, or Wikipedia special code!)
sparkle
  • 7,530
  • 22
  • 69
  • 131
127
votes
5 answers

Is there a Wikipedia API?

On my Wikipedia user page, I run a Wikipedia script that displays my statistics (number of pages edited, number of new pages, monthly activity, etc.). I'd like to put this information on my blog. Is there an API that would allow me to do something…
rbrayb
  • 46,440
  • 34
  • 114
  • 174
92
votes
3 answers

What is wikipedia pageid? how to change it into real page url?

I'm studying the wikipedia API, some demo api call What is the pageid? How do I change it into a real page url? I mean , how to change 18630637 into http://en.wikipedia.org/wiki/Translation?
yuli chika
  • 9,053
  • 20
  • 75
  • 122
43
votes
10 answers

Extract the first paragraph from a Wikipedia article (Python)

How can I extract the first paragraph from a Wikipedia article, using Python? For example, for Albert Einstein, that would be: Albert Einstein (pronounced /ˈælbərt ˈaɪnstaɪn/; German: [ˈalbɐt ˈaɪnʃtaɪn] ( listen); 14 March 1879 – 18 April …
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
40
votes
10 answers

Fetch a Wikipedia article with Python

I try to fetch a Wikipedia article with Python's urllib: f = urllib.urlopen("http://en.wikipedia.org/w/index.php?title=Albert_Einstein&printable=yes") s = f.read() f.close() However instead of the html page I get the following response:…
dkp
  • 825
  • 3
  • 9
  • 14
39
votes
12 answers

How to get plain text out of Wikipedia

I'd like to write a script that gets the Wikipedia description section only. That is, when I say /wiki bla bla bla it will go to the Wikipedia page for bla bla bla, get the following, and return it to the chatroom: "Bla Bla Bla" is the name of a…
Wifi
  • 391
  • 1
  • 3
  • 4
38
votes
4 answers

Searching Wikipedia using the API

I want to search Wikipedia using the query action. I am using this URL: http://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=apple That works, but I want to get into the first result of the search. How can I do that? Note:…
Muhammad Ashraf
  • 1,252
  • 1
  • 14
  • 32
38
votes
3 answers

How to obtain a list of titles of all Wikipedia articles

I'd like to obtain a list of all the titles of all Wikipedia articles. I know there are two possible ways to get content from a Wikimedia powered wiki. One would be the API and the other one would be a database dump. I'd prefer not to download the…
Flavio
  • 1,507
  • 5
  • 17
  • 30
35
votes
8 answers

Wikipedia API for geolocations

Is it possible, using the existing Wikipedia API's to get a list of articles around a Geo-location? Sort of like how Google maps does it? I would like to say that I am "here" and find out what is around me on Wikipedia. I can see on articles like…
Mark
  • 14,820
  • 17
  • 99
  • 159
29
votes
3 answers

How to get all article pages under a Wikipedia Category and its sub-categories?

I want to get all the articles names under a category and its sub-categories. Options I'm aware of: Using the Wikipedia API. Does it have such an option?? d/l the dump. Which format would be better for my usage? There is also an option to search…
Noam
  • 3,341
  • 4
  • 35
  • 64
27
votes
8 answers

Wikipedia text download

I am looking to download full Wikipedia text for my college project. Do I have to write my own spider to download this or is there a public dataset of Wikipedia available online? To just give you some overview of my project, I want to find out the…
Boolean
  • 14,266
  • 30
  • 88
  • 129
26
votes
2 answers

How to extract information from a Wikipedia infobox?

There is this fancy infobox in . How do I get the value of ?
Tgr
  • 27,442
  • 12
  • 81
  • 118
25
votes
3 answers

How to get Wikidata ID for an Wikipedia article by API?

How to obtain Wikidata ID from English Wikipedia article name, also for redirects? Is there API call? Example: Karachi >> Q8660 Karaachi >> Q8660 How to approach changes in assignment? Now Media in Karachi is redirect to Media of Pakistan (Wikidata…
Shoussi Elbril
  • 261
  • 3
  • 5
22
votes
2 answers

Multistream Wikipedia dump

I downloaded the german wikipedia dump dewiki-20151102-pages-articles-multistream.xml. My short question is: What does the 'multistream' mean in this case?
m4ri0
  • 597
  • 1
  • 6
  • 10
22
votes
8 answers

How to get the Infobox data from Wikipedia?

If I have the url to a page, how would I obtain the Infobox information on the right using MediaWiki webservices?
tomxu
  • 269
  • 1
  • 3
  • 6
1
2 3
99 100