Last active
October 21, 2024 07:12
-
-
Save bruderjakob12/67b99d35f8f182dc92a3c005c91be763 to your computer and use it in GitHub Desktop.
Aktiia PPG based blood-pressure measurement solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import datetime | |
| headers = { | |
| 'Authorization': 'Basic bW9iaWxlLWFwcDpxdG03cmpVTUJwWHgyY0tQNDNYc1g5Nzk=', | |
| 'Platform': 'Android', | |
| 'Time-Zone': 'Europe/Berlin', | |
| 'User-Agent': 'okhttp/4.10.0', | |
| 'Version-Code': '107', | |
| } | |
| # loggin in | |
| url = 'https://prod001-eu.aktiia.io/server-resolver/login' | |
| data = { | |
| 'grant_type': 'password', | |
| 'username': 'your_email@example.com', | |
| 'password': 'hunter42', | |
| } | |
| r1 = requests.post(url, data=data, headers=headers) | |
| # getting your aggregated data as presented in the apps | |
| url = 'https://prod001-eu.aktiia.io/physiological/api/v2/daily?date=' + datetime.datetime.now().strftime('%d-%m-%Y') | |
| headers['Authorization'] = 'bearer '+ r1.json()['access_token'] | |
| r2 = requests.get(url, headers=headers) | |
| print(r2.json()) | |
| # getting your single measurements | |
| yesterday = datetime.datetime.now() - datetime.timedelta(1) | |
| url = 'https://prod001-eu.aktiia.io/physiological/api/v2/measurements?from=' + yesterday.strftime('%d-%m-%Y') + '&to=' + datetime.datetime.now().strftime('%d-%m-%Y') | |
| headers['Authorization'] = 'bearer '+ r1.json()['access_token'] | |
| r3 = requests.get(url, headers=headers) | |
| print(r3.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment