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

When using the Wikipedia API, how to retrieve the style sheets?

I am trying to use the Wikipedia API to get HTML content from Wikipedia. I can't find the correct way to embed this. Since styles are not expanded, I woudld imagine I would need to specify the stylesheets used in the head of the HTML that embeds it.…
Shahar Prish
  • 4,838
  • 3
  • 26
  • 47
3
votes
1 answer

How to get content from the Wikipedia API for a movie?

I tried to get the description of the movie "Your Highness" from the Wikipedia API but it gives me nothing. http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=your%20highness&prop=revisions&rvprop=content When I google "Your Highness"…
Curtis
  • 2,486
  • 5
  • 40
  • 44
3
votes
1 answer

looking for a wikipedia api that can give me their article in XML

I am looking for a wikipedia api that can give me an article (no image) to a respective query. I have seen the wikipedia api used with actions=opensearch and query=search. Please tell me which one is correct or if there is any other action I should…
shivam oberoi
  • 237
  • 4
  • 8
3
votes
2 answers

Distinguish Wikipedia Disambiguations from Normal Pages

Currently, I'm attempting to retrieve the content of a given Wikipedia page to a plain text file. Using XPath, I have code that does this perfectly. However, there is just one simple problem: some pages on Wikipedia are disambiguation pages. Now,…
elliottbolzan
  • 1,057
  • 1
  • 15
  • 30
3
votes
1 answer

Wikipedia query returns error 403

I'm querying Wikipedia using the following code, but I always get an error (403 forbidden). When I type the exact same url in my browser, however, it works. I've been using the same code before to query other web apis, so I am not sure what's…
Pedro
  • 4,100
  • 10
  • 58
  • 96
3
votes
1 answer

Count wikipedia results

I'd like to get the number of Wikipedia pages matching a condition. e.g. "house" --> 1,200 pages "man" --> 13,000 pages "university college" --> 360 pages Among many other ways, I can do this by indexing Wikipedia with Lucene, but that's pretty…
Mulone
  • 3,603
  • 9
  • 47
  • 69
3
votes
1 answer

how to get search result from Wikipedia

I am using EditTextView , where user enter some text and make a search. I want to search the Wikipedia for and get result against the text. How do I can search a query from Wikipedia. I found the API. But I did not found a way to get the search…
Arslan Anwar
  • 18,746
  • 19
  • 76
  • 105
3
votes
1 answer

Wiki page scraping using Sheets (why is query not always working right?)

so with the help of the ppl here I've got this query for scraping a certain section from wiki page, but I've noticed it's not always working right. In some cases, it's scraping other data points sections in the page, and I can't figure out why. I…
3
votes
1 answer

RASA : ModuleNotFoundError: No module named 'wikipedia'

I'm learning to use rasa language. To diversify the answers of the goal I decided to use the Wikipedia api. To create my working environment I used anaconda with the following commands: conda create --name rasaWiki python == 3.7.6 conda activate…
user1222
  • 61
  • 1
  • 6
3
votes
1 answer

How to get the population of a location query (country or state/province and/or county) using wikipedia API?

I am trying to use the Covid-19 Dataset to build an SIR model. In order to build this model, I require the population of each location (country or province/state and/or county) to calculate the S (susceptible) in SIR. Since this dataset does not…
user10121139
3
votes
1 answer

How to access PetScan results programmatically?

I want to use Petscan https://petscan.wmflabs.org/ to find articles that belong to certain categories, etc... It is easy to do this with the website they provide. I was wondering if there is a way to do this in Python. I create a URL to send the…
user8954282
3
votes
2 answers

Real-time data streaming using Wikipedia's RecentChanges API

I'm lately trying to create a demo on real time streaming using NiFi -> Kafka -> Druid -> Superset. For the purposes of this demo I chose to use Wikipedia's RecentChanges API in order to get asynchronous data of the most recent changes. I use this…
Zisis F
  • 322
  • 5
  • 11
3
votes
2 answers

How can I get image title using Wikipedia API

Suppose, that I got URLs of images on the page, for i in wiki.images: print (i) Is there easy way to get images titles?
wos
  • 41
  • 3
3
votes
2 answers

Getting search results from wikidata website, but not API

I'm trying out the wikidata API but have some trouble with the search query "Jas 39 C Gripen". It returns results on the wikidata website, but not if I use the API. On The wikidata website I get two search results for the…
J. Margarine
  • 397
  • 1
  • 3
  • 8
3
votes
4 answers

What's the best way to interpret JSON from an api ?

I'm working on an app that uses the wikipedia api, and i'm struggling to find the best way to interpret the results given to me by the ajax request : The JSON I get looks like this : { "batchcomplete": "", "query": { "pages": { …
Hallemon
  • 161
  • 1
  • 14