Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Index

On this page

Keyman Version API 2.0 Specification

The api.keyman.com/version endpoint allows you to query the latest version of the downloads available for each Keyman product on https://downloads.keyman.com.

This API was previously named get-version from the deprecated endpoint https://r.keymanweb.com/code/get-version

API version 2.0

version is backwardly compatible with version 1.0. A plain call will return an integer return value, which is the latest stable build for KeymanWeb 2.0. See version 1.0 for further details.

Version 2.0 adds the ability to query for a given platform and stability level.

Syntax

https://api.keyman.com/version/platform[/level]

Parameters

platform
The platform to query against. Possible values are: android, ios, mac, web or windows.
level (optional)
The stability level to query, default stable. Possible values are: stable, beta or alpha.

If platform is not passed, then the API falls back to version 1.0

Return value

A JSON object.


{
  "platform": platform,
  "level": level,
  "version": version-string | "error": error-message
  
}

The version-string will be a dotted version that corresponds to the versioning scheme of the product. Note that version 2.0 of this API returns the whole version string for KeymanWeb, as opposed to version 1.0 of the API which returned only the last portion (build number).

If a version is not available for a given platform and stability level, then the error-message is returned instead of the version-string.

If invalid parameters are passed in, a 400 HTTP error is returned.

This build version can be embedded in the reference to the KeymanWeb code, e.g., for PHP:


$json = @file_get_contents('https://api.keyman.com/version/web/alpha');
if($json) {
  $json = json_decode($json);
}
if($json && property_exists($json, 'version')) {
  $kmwbuild = $json->version;
} else {
  // If the get-version API fails, we'll use the latest known version
  $kmwbuild = "2.0.469";
}
echo "<script src='https://s.keyman.com/kmw/engine/$kmwbuild/keymanweb.js'></script>";

API version 1.0

version should be called via HTTP GET to retrieve the latest build number. It will return an integer build number. In case of error, you should choose a known build number to reference (e.g. 377).

https://api.keyman.com/version

This build number can be embedded in the reference to the KeymanWeb code, e.g., for PHP:


$kmwbuild = @file_get_contents('https://api.keyman.com/version');

if($kmwbuild === FALSE || !is_numeric($kmwbuild)) {
  // If the get-version API fails, we'll use the latest known version
  $kmwbuild = 408;
}
echo "<script src='https://s.keyman.com/kmw/engine/$kmwbuild/keymanweb.js'></script>";

Version Information and History

1.0 - Released 19 January 2015

1.0 - Documentation updated 19 February 2017 to change secure site references to https://s.keyman.com/

2.0 - Released 23 June 2017

2.0 - Documentation updated 7 March 2018 to document API change from get-version to version and change secure site references to https://api.keyman.com

See Also

KeymanWeb Developer Home