Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

On this page

KeymanWeb Server Data API

The KeymanWeb Subscription Server has a RESTful JSON API which allows you to query it for information about available languages, keyboards and fonts.

Version Information and History

Version: 2.0

API usage

Version 2.0 of the API is a RESTful web service that returns only UTF-8 JSON format data. It can be called over HTTP or HTTPS. URIs in the data will reflect the protocol that is used to query the web service.

Interfaces

CallDescription
GET https://r.keymanweb.com/api/2.0/languages Returns a KeymanWeb object with a Languages object, that contains a list of all language and keyboard combinations available on the server. This call will return full details of every language, keyboard and font combination. It is typically around 150KB.
GET https://r.keymanweb.com/api/2.0/languages/fra Returns a KeymanWeb object with a Language object for a language identified by the language code fra.
GET https://r.keymanweb.com/api/2.0/keyboards Returns a KeymanWeb object with a Keyboards object, that contains a list of all keyboards on the server. The response is typically around 75KB.
GET https://r.keymanweb.com/api/2.0/keyboards/european Returns a KeymanWeb object with a Keyboard object for the keyboard identified by id european, and a list of all languages associated with that keyboard.
GET https://r.keymanweb.com/api/2.0/keyboards/european/fra Returns a KeymanWeb object with a Keyboard object for the keyboard identified by id european, and the language associated with fra.

Parameters

The parameters below are optional and can be provided as query parameters in the URL.

ParameterDescription
device Optional. Can currently be "windows", "macosx", "iphone", "ipad", "androidphone", "androidtablet", "mobile", "desktop", "tablet", "any". The server will filter keyboards according to the device type. If absent, then "any" is used.
dateformat Optional. Can be "seconds" or "standard". If absent, then "standard" is used. Reflects the format of any date values returned.

Structure

  • KeymanWeb object. The base object always returned from an API call. Contains the following members. The members keyboards, languages, keyboard and language are mutually exclusive:
    • options: Options object (required)
    • keyboards: Array of Keyboard objects
    • languages: Array of Language objects
    • keyboard: Keyboard object
    • language: Language object
  • Options object. Returns the query parameters plus contextual information. Contains the following members:
    • context: Context of the call. May be keyboards, languages, keyboard or language (required)
    • dateFormat: seconds or standard, per call parameter (required)
    • device: target device, per call parameter (required)
    • keyboardid: id of the keyboard queried, if provided (optional)
    • languageid: id of the language queried, if provided (optional)
    • keyboardBaseUri: fully qualified base path of any keyboard filenames presented in the data (required)
    • fontBaseUri: fully qualified base path of any font filenames presented in the data (required)
  • Language object. Contains the following members:
    • name: Name of language (required)
    • id: ISO639-3 language code (required)
    • keyboards: Array of Keyboard objects (optional)
    • font: Font object describing font for input fields and OSK (if oskFont not present). Only present when Language is child of Keyboard. (optional)
    • oskFont: Font object describing font for OSK. Only present when Language is child of Keyboard. (optional)
    • example: Example object. Only present when Language is child of Keyboard. (optional)
  • Keyboard object. Contains the following members:
    • name: Name of keyboard (required)
    • id: ID of keyboard, always matches the filename of the keyboard (required)
    • filename: Name of keyboard .js which should be combined with options.keyboardBaseUri (required)
    • default: true if the keyboard is the recommended default for the language (if absent, then false).
    • rtl: true if the keyboard targets a right-to-left script (if absent, then false).
    • lastModified: Date the keyboard file was last updated. (required)
    • fileSize: Size of the keyboard file in bytes. (required)
    • minVersion: Minimum build version of KeymanWeb that keyboard will work with. (optional)
    • maxVersion: Maximum build version of KeymanWeb that keyboard will work with. (optional)
    • languages: array of Language objects that are linked to the keyboard. (optional)
    • font: Font object describing font for input fields and OSK (if oskFont not present). Only present when Keyboard is child of Language. (optional)
    • oskFont: Font object describing font for OSK. Only present when Keyboard is child of Language. (optional)
    • example: Example object. Only present when Keyboard is child of Language. (optional)
  • Font object. Provides details on fonts for the keyboard/language. Contains the following members:
    • family: Font family that KeymanWeb will provide for this font. (optional)
    • size: Font size (in CSS dimensions), if not specified, then 1em. (optional)
    • source: Array of downloadable filenames for this font, which should be combined with options.fontBaseUri. (optional)
  • Example object. Provides an example piece of text to demonstrate how to use a keyboard. Contains the following members:
    • text: Output text that the key sequence will produce. (required)
    • keys: Key sequence (based on US English) to produce output text. (required)
    • note: English note about meaning of text. (required)

Example Call

GET https://r.keymanweb.com/api/2.0/keyboards/european/fra

Returns:

{
  "options": {
    "context":"keyboard",
    "dateFormat":"standard",
    "device":"any",
    "keyboardBaseUri":"https:\/\/s.keyman.com\/kmw\/kbd\/",
    "fontBaseUri":"https:\/\/r.keymanweb.com\/20\/fonts\/",
    "keyboardid":"european",
    "languageid":"fra"
  },
  "keyboard":{
    "id":"european",
    "filename":"european.js",
    "lastModified":"2012-03-02T16:36:15+11:00",
    "maxVersion":299,
    "languages":[
      {
        "id":"fra",
        "name":"French",
        "example":{
          "keys":"`A bient^ot",
          "text":"\u00c0 bient\u00f4t",
          "note":"\"Goodbye\""
        }
      }
    ]
  }
}

Feedback

If you have any feedback or questions, just fill in this form to get in touch.