All Projects → mudroljub → wikipedia-api-docs

mudroljub / wikipedia-api-docs

Licence: other
Wikipedia API documentation

Projects that are alternatives of or similar to wikipedia-api-docs

wiki-tui
A simple and easy to use Wikipedia Text User Interface
Stars: ✭ 74 (+21.31%)
Mutual labels:  wikipedia, wikipedia-api
Spell4Wiki
Spell4Wiki is a mobile application to record and upload audio for Wiktionary words to Wikimedia commons. Also act as a Wiki-Dictionary.
Stars: ✭ 17 (-72.13%)
Mutual labels:  wikipedia, wikimedia-api
wikipedia for humans
No description or website provided.
Stars: ✭ 44 (-27.87%)
Mutual labels:  wikipedia, wikipedia-api
wikiapi
JavaScript MediaWiki API for node.js
Stars: ✭ 28 (-54.1%)
Mutual labels:  wikipedia, wikipedia-api
pageviews.js
A lightweight JavaScript client library for the Wikimedia Pageviews API for Wikipedia and various of its sister projects for Node.js and the browser.
Stars: ✭ 24 (-60.66%)
Mutual labels:  wikipedia, wikipedia-api
go-wikidata
Wikidata API bindings in go.
Stars: ✭ 27 (-55.74%)
Mutual labels:  wikipedia, wikipedia-api
wikipedia-live-monitor
No description or website provided.
Stars: ✭ 19 (-68.85%)
Mutual labels:  wikipedia, wikipedia-api
wikifox
A clean and simplified WikiPedia powered by wikifox.js
Stars: ✭ 50 (-18.03%)
Mutual labels:  wikipedia, wikipedia-api
Wikifeedia
☔ Wikipedia turned into a newsfeed
Stars: ✭ 43 (-29.51%)
Mutual labels:  wikipedia
wikibot
A 🤖 which provides features from Wikipedia like summary, title searches, location API etc.
Stars: ✭ 25 (-59.02%)
Mutual labels:  wikipedia
wikipedia-reference-scraper
Wikipedia API wrapper for references
Stars: ✭ 34 (-44.26%)
Mutual labels:  wikipedia
wikirepo
Python based Wikidata framework for easy dataframe extraction
Stars: ✭ 33 (-45.9%)
Mutual labels:  wikipedia
wikipedia-preview
wikimedia.github.io/wikipedia-preview/main
Stars: ✭ 42 (-31.15%)
Mutual labels:  wikipedia
pw
Best websites a Programmer should visit
Stars: ✭ 27 (-55.74%)
Mutual labels:  wikipedia
TelegramBot-Go
Telegram bot which search information in Wikipedia and written on Go language
Stars: ✭ 35 (-42.62%)
Mutual labels:  wikipedia
today-AI-learned
Training a classifier to reddit's TIL to find new things on Wikipedia
Stars: ✭ 35 (-42.62%)
Mutual labels:  wikipedia
naacl2018-fever
Fact Extraction and VERification baseline published in NAACL2018
Stars: ✭ 109 (+78.69%)
Mutual labels:  wikipedia
wistalk
Wistalk : Analyze Wikipedia User's Activity
Stars: ✭ 19 (-68.85%)
Mutual labels:  wikipedia
grasp
Essential NLP & ML, short & fast pure Python code
Stars: ✭ 58 (-4.92%)
Mutual labels:  wikipedia-api
tech-seo-crawler
Build a small, 3 domain internet using Github pages and Wikipedia and construct a crawler to crawl, render, and index.
Stars: ✭ 57 (-6.56%)
Mutual labels:  wikipedia

Wikipedia API docs

Wikipedia API examples. For advanced use see Official Mediawiki API documentation

Quick intro:

  • All client requests should contain &origin=* because of CORS.
  • Search term should be capitalize (Tori Amos not tori amos) if multiple words.
  • You could request any wiki language you like (for example: sh.wikipedia.org or de.wikipedia.org)

Table of content

Articles

Get an article

GET full article for the requested title (titles=belgrade), with images (pageimages) and article URL (inprop=url). Also, follows redirection (redirects) if necessary:

en.wikipedia.org/w/api.php?action=query&titles=belgrade&prop=extracts|pageimages|info&pithumbsize=400&inprop=url&redirects=&format=json&origin=*

Previous request with minimal params:

en.wikipedia.org/w/api.php?action=query&titles=belgrade&prop=extracts&format=json

GET first paragraph of an article:

en.wikipedia.org/w/api.php?action=query&titles=Belgrade&prop=extracts&format=json&exintro=1

Search articles

To GET first 10 search results with extract and thumbnail image (prop=extracts|pageimages). Results is HTML by default, but we want json format:

en.wikipedia.org/w/api.php?action=query&generator=search&gsrsearch=belgrade&exintro=&prop=extracts|pageimages&format=json

GET first 20 search results (srlimit) with short info (prop=info):

en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&srlimit=20&srsearch=belgrade

GET first 20 search results (gsrlimit) with extract and thumbnail image (prop=extracts|pageimages). This time, article extract is set to plain text (explaintext):

en.wikipedia.org/w/api.php?action=query&generator=search&gsrlimit=20&prop=pageimages|extracts&exintro&explaintext&exlimit=max&format=json&gsrsearch=belgrade

Advanced search params:

  • gsrsearch=intitle:belgrade (word "belgrade" is in title)
  • gsrsearch=prefix:belgrade (article's title starts with the word "belgrade")

If you have problems, append &origin=* at the end of the route.

Images

GET the main image

Get source of the main image of the article:

en.wikipedia.org/w/api.php?action=query&titles=Belgrade&prop=pageimages&format=json&pithumbsize=250

GET all images from the article

Get all images from the article:

en.wikipedia.org/w/api.php?action=query&titles=belgrade&prop=images&format=json

Search free images

GET first 20 image files (gsrnamespace=6) from Wikimedia Commons with the term "Belgrade" in the filename (gsrsearch=intitle:Belgrade). Requested thumbnail size is 250px (pithumbsize=250):

commons.wikimedia.org/w/api.php?prop=pageimages|imageinfo|info|redirects&gsrnamespace=6&pilimit=max&pithumbsize=250&iiprop=extmetadata&iiextmetadatafilter=ImageDescription&action=query&inprop=url&redirects=&format=json&generator=search&gsrsearch=intitle:Belgrade&gsrlimit=20

Previous request without some params:

commons.wikimedia.org/w/api.php?prop=pageimages|info|redirects&gsrnamespace=6&pithumbsize=250&action=query&inprop=url&redirects=&format=json&generator=search&gsrsearch=intitle:Belgrade&gsrlimit=20

Remember, if you have problems, append &origin=* at the end of the route.

Quotes

GET wiki quotes for requested term (titles=Zen). The API is the same, just the domain is different (wikiquote.org):

en.wikiquote.org/w/api.php?action=query&titles=Zen&prop=extracts|info&inprop=url&redirects=&format=json

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].