API:すべての利用者

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page API:Allusers and the translation is 64% complete.

Other languages:
English • ‎dansk • ‎español • ‎polski • ‎中文 • ‎日本語
MediaWiki バージョン: 1.11

登録済みの利用者をその利用者名順にすべて列挙する GET リクエストです。

APIの説明文書


list=allusers (au)

(main | query | allusers)

Enumerate all registered users.

Parameters:
aufrom

The user name to start enumerating from.

auto

The user name to stop enumerating at.

auprefix

Search for all users that begin with this value.

audir

Direction to sort in.

One of the following values: ascending, descending
Default: ascending
augroup

Only include users in the given groups.

Values (separate with | or alternative): bot, sysop, interface-admin, bureaucrat, steward, accountcreator, import, transwiki, ipblock-exempt, oversight, autopatrolled, uploader, checkuser, translationadmin, flow-bot, confirmed
auexcludegroup

Exclude users in the given groups.

Values (separate with | or alternative): bot, sysop, interface-admin, bureaucrat, steward, accountcreator, import, transwiki, ipblock-exempt, oversight, autopatrolled, uploader, checkuser, translationadmin, flow-bot, confirmed
aurights

Only include users with the given rights. Does not include rights granted by implicit or auto-promoted groups like *, user, or autoconfirmed.

Values (separate with | or alternative): apihighlimits, applychangetags, autoconfirmed, autocreateaccount, autopatrol, bigdelete, block, blockemail, bot, browsearchive, changetags, createaccount, createpage, createtalk, delete, deletechangetags, deletedhistory, deletedtext, deletelogentry, deleterevision, edit, editcontentmodel, editinterface, editprotected, editmyoptions, editmyprivateinfo, editmyusercss, editmyuserjson, editmyuserjs, editmywatchlist, editsemiprotected, editsitecss, editsitejson, editsitejs, editusercss, edituserjson, edituserjs, hideuser, import, importupload, ipblock-exempt, managechangetags, markbotedits, mergehistory, minoredit, move, movefile, move-categorypages, move-rootuserpages, move-subpages, nominornewtalk, noratelimit, override-export-depth, pagelang, patrol, patrolmarks, protect, purge, read, reupload, reupload-own, reupload-shared, rollback, sendemail, siteadmin, suppressionlog, suppressredirect, suppressrevision, unblockself, undelete, unwatchedpages, upload, upload_by_url, userrights, userrights-interwiki, viewmyprivateinfo, viewmywatchlist, viewsuppressed, writeapi, spamblacklistlog, tboverride, tboverride-account, titleblacklistlog, gadgets-edit, gadgets-definition-edit, transcode-reset, transcode-status, urlshortener-manage-url, globalblock, globalblock-whitelist, globalblock-exempt, securepoll-create-poll, renameuser, nuke, torunblocked, skipcaptcha, override-antispoof, centralauth-merge, centralauth-unmerge, centralauth-lock, centralauth-oversight, globalgrouppermissions, globalgroupmembership, centralauth-rename, centralauth-usermerge, collectionsaveasuserpage, collectionsaveascommunitypage, repoadmin, codereview-use, codereview-add-tag, codereview-remove-tag, codereview-post-comment, codereview-set-status, codereview-signoff, codereview-associate, codereview-link-user, codereview-review-own, abusefilter-modify, abusefilter-log-detail, abusefilter-view, abusefilter-log, abusefilter-private, abusefilter-private-log, abusefilter-modify-restricted, abusefilter-revert, abusefilter-view-private, abusefilter-log-private, abusefilter-hidden-log, abusefilter-hide-log, abusefilter-modify-global, lqt-split, lqt-merge, lqt-react, massmessage, translate, translate-import, translate-manage, translate-messagereview, translate-groupreview, vipsscaler-test, flow-hide, flow-lock, flow-delete, flow-suppress, flow-edit-post, flow-create-board, usermerge, mwoauthproposeconsumer, mwoauthupdateownconsumer, mwoauthmanageconsumer, mwoauthsuppress, mwoauthviewsuppressed, mwoauthviewprivate, mwoauthmanagemygrants, oathauth-enable, oathauth-api-all, oathauth-disable-for-user, oathauth-view-log, newsletter-create, newsletter-delete, newsletter-manage, newsletter-restore, checkuser, checkuser-log, autoreviewrestore, stablesettings, review, unreviewedpages, movestable, validate, templateeditor, editeditorprotected, editextendedsemiprotected, extendedconfirmed, autoreviewprotected, viewdeletedfile, pagetranslation
Maximum number of values is 50 (500 for bots).
auprop

Which pieces of information to include:

blockinfo
Adds the information about a current block on the user.
groups
Lists groups that the user is in. This uses more server resources and may return fewer results than the limit.
implicitgroups
Lists all the groups the user is automatically in.
rights
Lists rights that the user has.
editcount
Adds the edit count of the user.
registration
Adds the timestamp of when the user registered if available (may be blank).
centralids
Adds the central IDs and attachment status for the user.
Values (separate with | or alternative): blockinfo, groups, implicitgroups, rights, editcount, registration, centralids
aulimit

How many total user names to return.

No more than 500 (5,000 for bots) allowed.
Type: integer or max
Default: 10
auwitheditsonly

Only list users who have made edits.

Type: boolean (details)
auactiveusers

Only list users active in the last 30 days.

Type: boolean (details)
auattachedwiki

With auprop=centralids, also indicate whether the user is attached with the wiki identified by this ID.

GET リクエスト

GET request to list all users, starting from those whose name begins with the string, "Drov"

レスポンス

{
    "batchcomplete": "",
    "continue": {
        "aufrom": "Drovark",
        "continue": "-||"
    },
    "query": {
        "allusers": [
            {
                "userid": 13239275,
                "name": "Drov"
            },
            {
                "userid": 7080866,
                "name": "Drova"
            },
            {
                "userid": 16013473,
                "name": "Drova 82"
            },
            ...
        ]
    }
}

サンプル コード

get_allusers.py

#!/usr/bin/python3

"""
    get_allusers.py

    MediaWiki Action API Code Samples
    Demo of `Allusers` module: GET request to list all users, 
    starting from those whose name begins with the string, "Drov"
    MIT license
"""

import requests

S = requests.Session()

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

PARAMS = {
    "action":"query",
    "format":"json",
    "list":"allusers",
    "auprefix":"Drov"
}

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

print(DATA)

起こりうるエラー

コード 情報
augroup-excludegroup group and excludegroup cannot be used together

パラメーターの履歴

  • v1.12: auprop=registration を導入しました

追加的な注記

  • This API call is case sensitive, so aufrom=DROV doesn't return the same results as aufrom=Drov.
  • All registered usernames are saved and retrieved in capitalized form. If you are using aufrom or auprefix in your query, make sure you are passing them values that start with an uppercase character.
  • Although the default behavior is to list any user in the database, we can also limit our response to only those users who belong to a certain group, such as sysops, or bots. User groups are how MediaWiki grants users certain rights and privileges; see Help:利用者権限と利用者グループ for more details on how this system works.

関連項目