The site info query is the simplest useful query in the wiki API. It returns the core metadata of the wiki, which is useful when a script needs to confirm that it is talking to the expected site.
The query
api.php?action=query&meta=siteinfo
What it returns
- General. Site name, version, main page and base address.
- Namespaces. The namespace list and their display names.
- Statistics. Page, edit and user counts when requested.
- Extensions. The extensions that are active on the wiki.
Use it as a check. A script that imports or exports pages should call site info first. A mismatch in the site name or the base address means the script is pointed at the wrong wiki.
The query is read only and requires no sign in. That makes it a safe first request when you are learning the API.
{
"query": {
"general": {
"sitename": "Skyway Wiki",
"mainpage": "Main Page"
}
}
}
The response above is shortened. The full response includes the namespace list and the software version.