Toolserver:getWikiAPI

The getWikiAPI is an API that makes it easy to identify a wiki with the help from the toolserver database. Originally developed to help in situations like bug 26664.

Formats
Currently is supports PHP (serialised) and JavaScript (JSON callback) as machine readable formats. For us humans there's also -texted output formats using var_dump and print_r available. By default it shows an XHTML page with a form for manual input.

Variation matching
The query tries the following variations to find a match
 * dbname = input
 * dbname = input_p
 * dbname = inputwiki_p
 * domain = input
 * domain = input.org

Autocomplete
If none of the variations or literals matched the following are attempted in the same query as fallback. Autocomplete sorts by  to determine the first (and only) result.
 * dname = inputwiki*
 * dname = input *
 * domain = input *

Parameters
Pipe-seperated string using any of the [[Toolserver: may be,  ,   or  . Default:  may be any string should only contain letters and numbers, without special characters or spaces. Default:
 * 1) Identifiers|]]. Multiple identifier types can be mixed. (required)

Examples
wikiids=meta|nlwiki_p|en.wikibooks  format=json   callback=myFunction

wikiids=betawikiv|media|http://de.wikibooks.org/  format=php_print

wikiids=betawikiv|media|http://de.wikibooks.org/  format=php

Return

 * (key): The key of the set is the string from the query that sent
 * input : same
 * search : The sanatized version used in the query (trimmed, hostname detection from url etc., trailing slash)
 * match : Boolean representing whether or not there was a match
 * data : Array containing the actual information
 * dbname : (straight from toolserver.wiki db) - Database name in the cluster
 * lang : (straight from toolserver.wiki db) - The MediaWiki language code, ISO 639-1 code, or ISO 639-3 code for the language
 * family : (straight from toolserver.wiki db) - Group of wikis this wiki belongs to (wikipedia, wikibooks, chapter, commons etc.)
 * domain : (straight from toolserver.wiki db) - Complete hostname with TLD
 * size : (straight from toolserver.wiki db) - Size
 * is_meta : (straight from toolserver.wiki db) - "1" or "0"
 * is_closed : (straight from toolserver.wiki db) - "1" or "0"
 * is_multilang : (straight from toolserver.wiki db) - "1" or "0"
 * root_category : (straight from toolserver.wiki db) - If available the name of the root category
 * server : (straight from toolserver.wiki db) - Wiki server assignments
 * script_path : (straight from toolserver.wiki db) - $wgScriptPath
 * wikicode : unique shortcode for each wiki (dbname without _p)
 * localdomain : local domain (more human readable). hostname without TLD
 * url : Valid URL to the wiki
 * apiurl : Valid URL to the main entry point of the api

Uses

 * Toolserver_database#wiki

Category:Data extracting tools Category:Search_tools Category:Database access tools