It is possible to access the U-Sleep services programmatically using the
U-Sleep Web API.
The API exposes a set of endpoints for controlling the Sleep Stager,
such as setting a model, uploading files, fetching logs and downloading the predicted hypnogram.
U-Sleep Web API allows for automated scoring of large collections of files without
having to repeatedly step through the Sleep Stager.
It is also possible to queue multiple prediction sessions concurrently.
Getting Access to the APITo request access to the API, please fill the API Access Request Form.
TermsAny use of the
U-Sleep Web API or Python bindings is subject to the
Terms of Service
Python BindingsA preliminary set of Python bindings to the API are available here. The repository also contains an annotated example of how to use the Python bindings.
When using the
U-Sleep Web API it is possible to queue multiple prediction sessions concurrently
(currently limited to 5 maximum concurrent sessions per user).
/api/v1/sleep_stager/* endpoints accept the path parameter
Each session stores information on which model to use, what file to predict on and handles to output log- and hypnogram files.
Note that the
default session is used by the browser when accessing U-Sleep via the Sleep Stager.