Cosinuss Api Python

Download the zip and extract:

If you are already familiar with python syntax, then it is fairly easy to work with the scripts.

It is required to have the latest version of python installed on your system. If you do not have python on your system, you can install it here. please follow their instruction for installation depending on your operating system.

if you have windows as your operating system, then you need to also add python to PATH on your system as described in details here

In addition, installation of python packages are also required, which can be done easily using pip or pip3 for installation(depending on your operating system).

pip3 install python-jose 
pip3 install pandas 
pip3 install pathlib 
pip3 install requests 

In case you also want to plot the data, then you also need to pip or pip3 install matplotlib as well:

pip3 install matplotlib 

you can save the downloaded zip file in any location on your system. when you extract the zip file, then the content of folder is structured as demonstrated below:

├── cosinuss_api
    ├── cosinuss/
    └── cosinuss/

The cosinuss/*.py files are cosinuss lib. With you can test available routes of the cosinuss API and with you can download data from a project.

Before downloading the data change the config part of the script Replace params with your own username, project_hash and define your target data_path. And define the data_types you want to download.

username = 'username'
password = 'xxx'
project_hash = '6QP3'
data_path = Path('data_export')
data_types = ['heart_rate', 'spo2']

If you want to download and store all the data files that are created for your project, then please run the in the command line as below:


alternatively, if you are a windows user:


The script will not download the same data twice unless you delete the corresponding file again. Therefore, pay attention if the data file is from the same day and new data is still being recorded. You can change the code or make your own code to avoid this.

provide each script with username and password of your own account ID and password. Make sure that your username is assigned to all projects, otherwise the returned x and y values will be empty.

Note: Pay attention that the user role should be api, otherwise an access will be denied. Also don't forget to assign the user to the specific projects from which the data shall be downloaded.

any feedback would be welcome. We encourage you to also visit our documentation and user manuals. If you have any issues or questions, you can contact your supervisor via email. We will get in touch as soon as possible.

  • public/api_python.1648637421.txt.gz
  • Last modified: 2022/03/30 12:50
  • by shabnam.motamedirad