API:Langbacklinks - MediaWiki (original) (raw)

This page is part of the MediaWiki Action API documentation.
MediaWiki version: ≥ 1.18

GET request to find all pages that link to the given language link.

The following documentation is the output of Special:ApiHelp/query+langbacklinks, 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 language link.

Can be used to find all links with a language code, or all links to a title (with a given language). Using neither parameter is effectively "all language links".

Note that this may not consider language links added by extensions.

Specific parameters:

lbllang

Language for the language link.

lbltitle

Language link to search for. Must be used with lbllang.

lblcontinue

When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.

lbllimit

How many total pages to return.

Type: integer or max

The value must be between 1 and 500.

Default: 10

lblprop

Which properties to get:

lllang

Adds the language code of the language link.

lltitle

Adds the title of the language link.

Values (separate with | or alternative): lllang, lltitle

Default: (empty)

lbldir

The direction in which to list.

One of the following values: ascending, descending

Default: ascending

Get pages linking to a given language link.

{ "batchcomplete": "", "query": { "langbacklinks": [] } }

#!/usr/bin/python3

""" langbacklinks.py MediaWiki API Demos Demo of Langbacklinks module: Get pages linking to a given language link MIT License """

import requests

S = requests.Session()

URL = "https://en.wikipedia.org/w/api.php"

PARAMS = { "action": "query", "list": "langbacklinks", "lbltitle": "Test", "lbllang": "fr", "format": "json" }

R = S.get(url=URL, params=PARAMS) DATA = R.json()

print(DATA)

"query", "list" => "langbacklinks", "lbltitle" => "Test", "lbllang" => "fr", "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 ); result=jsondecode(result = json_decode( result=jsondecode(output, true ); var_dump( $result ); /* langbacklinks.js MediaWiki API Demos Demo of `Langbacklinks` module: Get pages linking to a given language link MIT License */ var url = "https://en.wikipedia.org/w/api.php"; var params = { action: "query", list: "langbacklinks", lbltitle: "Test", lbllang: "fr", 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);}); /* langbacklinks.js MediaWiki API Demos Demo of `Langbacklinks` module: Get pages linking to a given language link MIT License */ var params = { action: 'query', list: 'langbacklinks', lbltitle: 'Test', lbllang: 'fr', format: 'json' }, api = new mw.Api(); api.get( params ).done( function ( data ) { console.log( data ); } ); | Code | Info | | ------------ | ------------------------------- | | missingparam | The lang parameter must be set. | * v1.20: Introduced `dir` * This module can be used to find all pages that link to the given language link. It finds all links using a language code, or all links to a given title (with a given language). Using neither parameter is effectively `All Language Links`. * [API:Links](/wiki/Special:MyLanguage/API:Links "Special:MyLanguage/API:Links")[ ](/wiki/API:Links "API:Links") – Returns all links from the given pages. * [API:Langlinks](/wiki/Special:MyLanguage/API:Langlinks "Special:MyLanguage/API:Langlinks")[ ](/wiki/API:Langlinks "API:Langlinks") – Gets a list of all language links from the provided pages to other languages.