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
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
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
81
votes
12 answers

How can I 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,505
  • 10
  • 50
  • 68
75
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,648
  • 8
  • 45
  • 73
71
votes
9 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
  • 1,521
  • 5
  • 28
  • 44
64
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
  • 20,791
  • 29
  • 77
  • 90
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
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
  • 964
  • 1
  • 8
  • 17
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
31
votes
5 answers

Wikipedia API + Cross-origin requests

I'm trying to access Wikipedia using JavaScript and 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…
Pierre
  • 34,472
  • 31
  • 113
  • 192
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
28
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
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
1
2 3
72 73