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

How to print mid popular summary of random post of certain topic from Wikipedia?

I want to print mid popular summary of random post of certain topic from Wikipedia using Wikipedia API but I am getting completely random topic. I have tried this: import requests def get_wikipedia(topic): response =…
Shounak Das
  • 350
  • 12
-1
votes
1 answer

Wikipedia metadata dump?

I need metadata for wikipedia articles (title, views, time edited, categories, etc.). I was looking through the dumps at https://dumps.wikimedia.org/enwiki/20221201/ and there's so many that I'm not sure what to choose. I don't need a full dump…
Jabrove
  • 718
  • 5
  • 13
-1
votes
1 answer

Download wikipedia with navigation popup text included

Does anyone know if I can download Wikipedia text data with the navigation popups included? I know there are existing text dump datasets [1,2], but as far as I can tell, they do not include the navigation popup text. [1]…
-1
votes
1 answer

Python Wikipedia Library does not find requested page eventhough it exists

So I want to search the wikipedia database for some keywords and then extract the text that the relative pages have to then use for a tf-idf module to later on implement in a text classification program. I am currently looping through a pandas…
-1
votes
1 answer

how to fetch a wikipedia geosearch with a correct origin?

I want to add a "wikipedia-geosearch" feature to my interactive map. Here is the simplest code for that operation, first attempt: const buildWikiGeoSearch = (cn, rd, [lon,lat]) => …
allez l'OM
  • 547
  • 4
  • 13
-1
votes
1 answer

How to get main article for a category using wikipedia dumps?

Main article for category Given any category, I need to get the main article for the same if it exists.
-1
votes
1 answer

ValueError: Either a title or a pageid must be specified

The code displayed below is giving me a ValueError, explaining I need a title or pagid specified. I have checked the code over and over and do not see a problem. Please let me know if you have any idea what I am doing wrong. This code is meant to…
brrrrrrrt
  • 51
  • 2
  • 13
-1
votes
1 answer

Get timestamp from Wikipedia API in Python

I'm trying to get the timestamp from the Wikipedia-api and split it in format (y-m-d), but still can not find a way around to do that. import requests S = requests.Session() URL = "https://en.wikipedia.org/w/api.php?" PARAMS = { …
-1
votes
1 answer

Google gives relevant wiki images than Wiki Api

Below is the wiki api which gives relevant images from…
-1
votes
1 answer

Can't display data Fetched from the internet in Flutter using http Wikipedia intro Api

import 'dart:async'; import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:carousel_pro/carousel_pro.dart'; import 'package:http/http.dart' as http; class Home extends StatelessWidget { @override Widget…
-1
votes
1 answer

Parsing Wikipedia API with PHP

I have a PHP script that retrieves the JSON result from the Wikipedia API and stores it in $json variable, then I json decode it into $data:
jjj
  • 2,594
  • 7
  • 36
  • 57
-1
votes
2 answers

Taking an input from textbox and adding it the url endpoint in jquery get method

I am trying to add the search string to the api end point and attach it to the call back function. var searchString; $("document").ready(function(){ $.get( "https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=" +…
-1
votes
1 answer

table = soup.find("table", { "class" : "infobox ww_ib ww_ib_1" }) is not working

I'm trying to parse the table given at this location: "http://en.wikipedia.org/wiki/Quartz" The property table is identified as the class = infobox ww_ib ww_ib_1. I am expecting to obtain the values given in the table such as: 'Category, Oxide,…
vineeth venugopal
  • 1,064
  • 1
  • 9
  • 17
-1
votes
1 answer

Javascript - Wikipedia API sends extract that contains weird encode

This is what I get from sending a GET request to the wikipedia API Norway (\u00a0(\u00a0listen); Norwegian: \u00a0Norge (Bokm\u00e5l) or \u00a0Noreg (Nynorsk); Northern Sami: Norga) Officially the Kingdom of Norway, is a sovereign state and…
Herman Neple
  • 156
  • 12
-1
votes
1 answer

Getting "See also" section in a Wikipedia page

I want to get all the links in the "See also" section in a wikipedia article, but wikipedia API for python (Wikipedia documentation) doesn't provide those information. Even if I use "page" function to get the whole content of a page to extract the…
amiref
  • 3,181
  • 7
  • 38
  • 62