Skip to content
Model centric tools for Spring development Community portal
Skyway PerspectivesModel driven delivery

Wiki / API reference

Wiki API: Site Statistics

The statistics query returns page, edit, user and file counts. It is the quickest way to confirm that a backup or migration carried every page across.

The statistics query returns the counts that describe the size of the wiki. It is short and read only, which makes it useful for a backup check or a migration check.

The query

api.php?action=query&meta=siteinfo&siprop=statistics

Counts it returns

  • Pages. The number of content pages.
  • Edits. The total number of saved edits.
  • Users. The number of registered members.
  • Files. The number of uploaded files.
  • Jobs. The number of queued maintenance jobs.
Migration check. Record the counts before a migration and compare them afterwards. A difference is not always an error, but it always deserves an explanation.

The query uses the same site info call as the previous page, with the statistics property added. That pattern is common in the wiki API: one query call with a different set of properties.

{
  "query": {
    "statistics": {
      "pages": 0,
      "edits": 0,
      "users": 0,
      "files": 0
    }
  }
}

The example above shows the shape of the response. The live values depend on the wiki that answers the call.

Previous: site info

MediaWiki siteinfo reference