A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo below:

API:Siteinfo - MediaWiki

This page is part of the MediaWiki Action API documentation.

GET Request to get overall site information.

API documentation

The following documentation is the output of Special:ApiHelp/query+siteinfo, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org).

Return general information about the site.

Specific parameters:

siprop

Which information to get:

general
Overall system information.
namespaces
List of registered namespaces and their canonical names.
namespacealiases
List of registered namespace aliases.
specialpagealiases
List of special page aliases.
magicwords
List of magic words and their aliases.
interwikimap
Returns interwiki map (optionally filtered, optionally localised by using siinlanguagecode).
dbrepllag
Returns database server with the highest replication lag.
statistics
Returns site statistics.
usergroups
Returns user groups and the associated permissions.
autocreatetempuser
Returns configuration for the automatic creation of temporary user accounts (also known as IP masking).
clientlibraries
Returns client-side libraries installed on the wiki
libraries
Returns libraries installed on the wiki.
extensions
Returns extensions installed on the wiki.
fileextensions
Returns list of file extensions (file types) allowed to be uploaded.
rightsinfo
Returns wiki rights (license) information if available.
restrictions
Returns information on available restriction (protection) types.
languages
Returns a list of languages MediaWiki supports (optionally localised by using siinlanguagecode).
languagevariants
Returns a list of language codes for which LanguageConverter is enabled, and the variants supported for each.
skins
Returns a list of all enabled skins (optionally localised by using siinlanguagecode, otherwise in the content language).
extensiontags
Returns a list of parser extension tags.
functionhooks
Returns a list of parser function hooks.
showhooks
Returns a list of all subscribed hooks (contents of $wgHooks).
variables
Returns a list of variable IDs.
protocols
Returns a list of protocols that are allowed in external links.
defaultoptions
Returns the default values for user preferences.
uploaddialog
Returns the upload dialog configuration.
autopromote
Returns the automatic promotion configuration.
autopromoteonce
Returns the automatic promotion configuration that are only done once.
copyuploaddomains
Returns the list of allowed copy upload domains
Values (separate with | or alternative): autocreatetempuser, autopromote, autopromoteonce, clientlibraries, copyuploaddomains, dbrepllag, defaultoptions, extensions, extensiontags, fileextensions, functionhooks, general, interwikimap, languages, languagevariants, libraries, magicwords, namespacealiases, namespaces, protocols, restrictions, rightsinfo, showhooks, skins, specialpagealiases, statistics, uploaddialog, usergroups, variables
Default: general
sifilteriw

Return only local or only nonlocal entries of the interwiki map.

One of the following values: !local, local
sishowalldb

List all database servers, not just the one lagging the most.

Type: boolean (details)
sinumberingroup

Lists the number of users in user groups.

Type: boolean (details)
siinlanguagecode

Language code for localised language names (best effort) and skin names.

Examples

GET request

Get general site information.

Response

{
    "batchcomplete": true,
    "query": {
        "general": {
            "mainpage": "Main Page",
            "base": "https://en.wikipedia.org/wiki/Main_Page",
            "sitename": "Wikipedia",
            ...
        }
    }
}

Sample code

Python

#!/usr/bin/python3

"""
    general_site_info.py

    MediaWiki API Demos
    Demo of `Siteinfo` module: Obtain general site info.

    MIT License
"""

import requests

S = requests.Session()

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

PARAMS = {
    "action": "query",
    "meta": "siteinfo",
    "formatversion": "2",
    "format": "json"
}

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

print(DATA)

PHP

<?php

/*
    general_site_info.php

    MediaWiki API Demos
    Demo of `Siteinfo` module: Obtain general site info.

    MIT License
*/

$endPoint = "https://en.wikipedia.org/w/api.php";
$params = [
    "action" => "query",
    "meta" => "siteinfo",
    "formatversion" => "2",
    "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 );

echo( $output );

JavaScript

/*
    general_site_info.js

    MediaWiki API Demos
    Demo of `Siteinfo` module: Obtain general site info.

    MIT License
*/

var url = "https://en.wikipedia.org/w/api.php"; 

var params = {
    action: "query",
    meta: "siteinfo",
    formatversion: "2",
    format: "json"
};
request.get({ url: url, qs: params }, function(error, res, body) {
    if (error) {
        return;
    }
    console.log(body);
});

MediaWiki JS

/*
	general_site_info.js

    MediaWiki API Demos
    Demo of `Siteinfo` module: Obtain general site info.

    MIT License
*/

var params = {
    action: "query",
    meta: "siteinfo",
    formatversion: "2",
    format: "json"
},
api = new mw.Api();

api.get( params ).done( function ( data ) {
console.log( data );
} );

Results

This section documents only those result sections where there are numerous or non-obvious return values. Results like those found in namespacealiases or libraries, where the meaning of each item can be readily inferred, are not listed here.

Extensions

General

The general option can return the following results:

Interwikimap

The attributes provided in each iw element include:

Namespaces

Each namespace is given within its own element, which contains several attributes:

Restrictions

Provides information about the various forms of page protection available.

Rightsinfo

In the best case this will provide:

Statistics

This section provides similar info to Special:Statistics, along with the number of jobs in the job queue, in the following elements:

Other statistics may be included via the APIQuerySiteInfoStatisticsInfo hook.

Usergroups

This retrieves a list of all groups on the wiki, along with their rights and possibly other statistics.

Possible errors

Code Info includeAllDenied Cannot view all servers' info unless $wgShowHostnames is true.

Parameter history

Additional notes

See also


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