≥ 1.24
GET request to find all pages that link to the given pages.
The following documentation is the output of Special:ApiHelp/query+linkshere, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org).Find all pages that link to the given pages.
Specific parameters:
Which properties to get:
Only include pages in these namespaces.
Show only items that meet these criteria:
How many to return.
When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.
Get a list of pages linking to the
Main Page.
{ "continue": { "lhcontinue": "1868", "continue": "||" }, "query": { "pages": { "15580374": { "pageid": 15580374, "ns": 0, "title": "Main Page", "linkshere": [ { "pageid": 354, "ns": 1, "title": "Talk:Algeria" }, { "pageid": 672, "ns": 1, "title": "Talk:Arc de Triomphe" }, ... ] } } } }
#!/usr/bin/python3 """ linkshere.py MediaWiki API Demos Demo of `Linkshere` module: Get a list of pages linking to a given page MIT License """ import requests S = requests.Session() URL = "https://en.wikipedia.org/w/api.php" PARAMS = { "action": "query", "titles": "Main Page", "prop": "linkshere", "format": "json" } R = S.get(url=URL, params=PARAMS) DATA = R.json() print(DATA)
<?php /* linkshere.php MediaWiki API Demos Demo of `Linkshere` module: Get a list of pages linking to a given page MIT License */ $endPoint = "https://en.wikipedia.org/w/api.php"; $params = [ "action" => "query", "titles" => "Main Page", "prop" => "linkshere", "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 ); var_dump( $result );
/* linkshere.js MediaWiki API Demos Demo of `Linkshere` module: Get a list of pages linking to a given page MIT License */ var url = "https://en.wikipedia.org/w/api.php"; var params = { action: "query", titles: "Main Page", prop: "linkshere", 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) {console.log(response);}) .catch(function(error){console.log(error);});
/* linkshere.js MediaWiki API Demos Demo of `Linkshere` module: Get a list of pages linking to a given page MIT License */ var params = { action: 'query', titles: 'Main Page', prop: 'linkshere', format: 'json' }, api = new mw.Api(); api.get( params ).done( function ( data ) { console.log( data ); } );Code Info show Incorrect parameter - mutually exclusive values may not be supplied.
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