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.

984 questions
161
votes
12 answers

Is there a wikipedia API just for retrieve content summary?

I need just to retrieve first paragraph of a Wikipedia page. Content must be html formated, ready to be displayed on my website (so NO BBCODE, or WIKIPEDIA special CODE!)
sparkle
  • 6,527
  • 18
  • 58
  • 92
84
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
  • 8,479
  • 19
  • 73
  • 121
63
votes
8 answers

How to use wikipedia api if it exists?

I'm trying to find out if there's a Wikipedia API (I think it is related to the MediaWIki?). If so, I would like to know how I would tell Wikipedia to give me an article about the new york yankees for example. What would the REST URL be for this…
chris
  • 18,595
  • 28
  • 74
  • 88
63
votes
11 answers

How to get Wikipedia content using Wikipedia's API?

I want to get the first paragraph of a Wikipedia article. What is the API query to do so?
bbnn
  • 3,114
  • 8
  • 46
  • 64
63
votes
10 answers

Get Text Content from mediawiki page via API

I'm quite new to MediaWiki, and now I have a bit of a problem. I have the title of some Wiki page, and I want to get just the text of a said page using api.php, but all that I have found in the API is a way to obtain the Wiki content of the page…
Le_Coeur
  • 2,007
  • 5
  • 28
  • 42
61
votes
14 answers

Accessing main picture of wikipedia page by API

Is there any way I can access the thumbnail picture of any wikipedia page by using an API? I mean the image on the top right side in box. Is there any APIs for that?
insomiac
  • 5,354
  • 7
  • 42
  • 71
34
votes
4 answers

How can I get the Infobox from a Wikipedia article by the MediaWiki API?

Wikipedia articles may have Infobox templates. By the following call I can get the first section of an article which includes an Infobox. http://en.wikipedia.org/w/api.php?action=parse&pageid=568801§ion=0&prop=wikitext I want a query which will…
Erdem
  • 944
  • 1
  • 8
  • 16
32
votes
3 answers

Searching Wikipedia using 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,192
  • 1
  • 13
  • 31
31
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,302
  • 17
  • 94
  • 158
29
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
  • 291
  • 1
  • 3
  • 4
29
votes
2 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,279
  • 3
  • 14
  • 28
27
votes
5 answers

Is there any API in Java to access wikipedia data

I want to know: is there any API or a query interface through which I can access Wikipedia data?
neha
25
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,253
  • 3
  • 30
  • 50
24
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
  • 25,494
  • 11
  • 77
  • 108
21
votes
5 answers

Wikipedia API + Cross-origin requests

I'm trying to access wikipedia using javascript+CORS As far as I know, wikipedia should support CORS: http://www.mediawiki.org/wiki/API:Cross-site_requests I tried the following script: create a XMLHttpRequest+credential/XDomainRequest, add some…
Pierre
  • 31,741
  • 29
  • 101
  • 180
1
2 3
65 66