API:Iwbacklinks - MediaWiki (original) (raw)
| This page is part of the MediaWiki Action API documentation. |
|---|
GET request to get all pages that link to the given interwiki link.
| MediaWiki version: | ≥ 1.17 |
|---|
| The following documentation is the output of Special:ApiHelp/query+iwbacklinks, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
|---|
- This module requires read rights.
- This module can be used as a generator.
- Source: MediaWiki
- License: GPL-2.0-or-later
Find all pages that link to the given interwiki link.
Can be used to find all links with a prefix, or all links to a title (with a given prefix). Using neither parameter is effectively "all interwiki links".
Specific parameters:
iwblprefix
Prefix for the interwiki.
iwbltitle
Interwiki link to search for. Must be used with iwblblprefix.
iwblcontinue
When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.
iwbllimit
How many total pages to return.
Type: integer or max
The value must be between 1 and 500.
Default: 10
iwblprop
Which properties to get:
iwprefix
Adds the prefix of the interwiki.
iwtitle
Adds the title of the interwiki.
Values (separate with | or alternative): iwprefix, iwtitle
Default: (empty)
iwbldir
The direction in which to list.
One of the following values: ascending, descending
Default: ascending
Get pages that link to a given interwiki link.
{ "batchcomplete": "", "continue": { "iwblcontinue": "wikibooks|Main_Page|438739", "continue": "-||" }, "query": { "iwbacklinks": [ { "pageid": 18606, "ns": 0, "title": "Liberation Tigers of Tamil Eelam" }, { "pageid": 43347, "ns": 1, "title": "Talk:Vi" }, ... ] } }
#!/usr/bin/python3
""" iwbacklinks.py
MediaWiki API Demos
Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link.
MIT License"""
import requests
S = requests.Session()
URL = "https://en.wikipedia.org/w/api.php"
PARAMS = { "action": "query", "list": "iwbacklinks", "iwblprefix": "wikibooks", "iwbltitle": "Main_Page", "format": "json" }
R = S.get(url=URL, params=PARAMS) DATA = R.json()
print(DATA)
"query", "list" => "iwbacklinks", "iwblprefix" => "wikibooks", "iwbltitle" => "Main_Page", "format" => "json" ]; url=url = url=endPoint . "?" . http_build_query( $params ); ch=curlinit(ch = curl_init( ch=curlinit(url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); output=curlexec(output = curl_exec( output=curlexec(ch ); curl_close( $ch ); echo( $output ); /* iwbacklinks.js MediaWiki API Demos Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link. MIT License */ var url = "https://en.wikipedia.org/w/api.php"; var params = { action: "query", list: "iwbacklinks", iwblprefix: "wikibooks", iwbltitle: "Main_Page", 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);}); /* iwbacklinks.js MediaWiki API Demos Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link. MIT License */ var params = { action: 'query', list: 'iwbacklinks', iwblprefix: 'wikibooks', iwbltitle: 'Main_Page', format: 'json' }, api = new mw.Api(); api.get( params ).done( function ( data ) { console.log( data ); } ); | Code | Info | | --------------------------- | ------------------------------------------------------------- | | invalidparammix-mustusewith | The _iwbltitle_ parameter may only be used with _iwblprefix_. | * v1.20: Introduced `iwbldir` * This module can be used to find all pages that link to the given interwiki link. It finds all links using a prefix, or all links to a given title (with a given prefix). Using neither parameter returns `All IW Links`. * [API:Iwlinks](/wiki/Special:MyLanguage/API:Iwlinks "Special:MyLanguage/API:Iwlinks")[ ](/wiki/API:Iwlinks "API:Iwlinks") – List interwiki links from a given page. * [API:Links](/wiki/Special:MyLanguage/API:Links "Special:MyLanguage/API:Links")[ ](/wiki/API:Links "API:Links") – Find all the links on the provided page(s). * [API:Linkshere](/wiki/Special:MyLanguage/API:Linkshere "Special:MyLanguage/API:Linkshere")[ ](/wiki/API:Linkshere "API:Linkshere") – Find all pages that link to the given pages. * [API:Extlinks](/wiki/Special:MyLanguage/API:Extlinks "Special:MyLanguage/API:Extlinks")[ ](/wiki/API:Extlinks "API:Extlinks") – Gets a list of all external links on the provided pages.