GET request to list all the recent changes to the wiki, in the same manner as Special:RecentChanges lists them.
The following documentation is the output of Special:ApiHelp/query+recentchanges, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org).Enumerate recent changes.
Specific parameters:
The timestamp to start enumerating from.
The timestamp to end enumerating.
In which direction to enumerate:
Filter changes to only these namespaces.
Only list changes by this user.
Don't list changes by this user.
Only list changes tagged with this tag.
Include additional pieces of information:
Show only items that meet these criteria. For example, to see only minor edits done by logged-in users, set rcshow=minor|!anon.
How many total changes to return.
Which types of changes to show.
Only list changes which are the latest revision.
Filter entries to those related to a page.
When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.
When being used as a generator, generate revision IDs rather than titles. Recent change entries without associated revision IDs (e.g. most log entries) will generate nothing.
Only list changes that touch the named slot.
Get the 3 most recent changes with sizes and flags
{ "batchcomplete": "", "continue": { "rccontinue": "20180330090522|1041353210", "continue": "-||" }, "query": { "recentchanges": [ { "type": "edit", "ns": 0, "title": "Histology", "pageid": 13570, "revid": 833218500, "old_revid": 833218201, "rcid": 1041353213, "user": "Iztwoz", "oldlen": 25718, "newlen": 25749 } ... ] } }
#!/usr/bin/python3 """ get_recent_changes.py MediaWiki API Demos Demo of `RecentChanges` module: Get the three most recent changes with sizes and flags MIT License """ import requests S = requests.Session() URL = "https://en.wikipedia.org/w/api.php" PARAMS = { "format": "json", "rcprop": "title|ids|sizes|flags|user", "list": "recentchanges", "action": "query", "rclimit": "3" } R = S.get(url=URL, params=PARAMS) DATA = R.json() RECENTCHANGES = DATA['query']['recentchanges'] for rc in RECENTCHANGES: print(str(rc['title']))
<?php /* get_recent_changes.php MediaWiki API Demos Demo of `RecentChanges` module: Get the three most recent changes with sizes and flags MIT License */ $endPoint = "https://en.wikipedia.org/w/api.php"; $params = [ "action" => "query", "list" => "recentchanges", "rcprop" => "title|ids|sizes|flags|user", "rclimit" => "3", "format" => "json" ]; $url = $endPoint . "?" . http_build_query( $params ); $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); $output = curl_exec( $ch ); curl_close( $ch ); $result = json_decode( $output, true ); foreach( $result["query"]["recentchanges"] as $rc ){ echo( $rc["title"] . "\n" ); }
/* get_recent_changes.js MediaWiki API Demos Demo of `RecentChanges` module: Get the three most recent changes with sizes and flags MIT License */ var url = "https://en.wikipedia.org/w/api.php"; var params = { action: "query", list: "recentchanges", rcprop: "title|ids|sizes|flags|user", rclimit: "3", format: "json" }; url = url + "?origin=*"; Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];}); fetch(url) .then(function(response){return response.json();}) .then(function(response) { var recentchanges = response.query.recentchanges; for (var rc in recentchanges) { console.log(recentchanges[rc].title); } }) .catch(function(error){console.log(error);});
/* get_recent_changes.js MediaWiki API Demos Demo of `RecentChanges` module: Get the three most recent changes with sizes and flags MIT License */ var params = { action: 'query', list: 'recentchanges', rcprop: 'title|ids|sizes|flags|user', rclimit: '3', format: 'json' }, api = new mw.Api(); api.get( params ).done( function ( data ) { var recentchanges = data.query.recentchanges, rc; for ( rc in recentchanges ) { console.log( recentchanges[ rc ].title ); } } );Code Info rcshow Incorrect parameter - mutually exclusive values may not be supplied. rcpermissiondenied You need the
patrol
or patrolmarks
right to request the patrolled flag.
rctoken
rctitles
rctitles
loginfo
recentchanges
table slightly out of order with respect to their timestamp. Thus, when requesting the most recent changes twice in a row, the second response may contain new changes inserted a few seconds before the most recent one in the first response. If you repeatedly call this module to get a stream a recent change, consider adding some overlap between requests to not miss any changes.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4