How to get health data from Open Humans
Open Humans is a platform that allows individuals to share personal data for research and personal projects. Some of the individuals allow access to their health data via the Public API. For instance, in the case of NightScout, a real-time diabetes monitoring tool, users can upload their data via the Open Humans synchronization tool in their artificial pancreas app AndroidAPS.
To get a list of projects from which you can access public data on Open Humans you can go to:
https://www.openhumans.org/api/public/datatypes/
You can find more details about every specific project via this page:
https://www.openhumans.org/explore-share/
You can get the data of a specific project by following the following steps:
A. Install Python
Windows
- Go to the Python website.
- Download the latest Python installer for Windows.
- Run the installer and check “Add Python to PATH”.
- Click “Install Now”.
Mac
- Go to the Python website.
- Download the latest Python installer for macOS.
- Open the downloaded .pkg file.
- Follow the on-screen instructions to complete the installation
B. Open terminal
Windows
- Press
Windows + R
to open the Run dialog. - Type
cmd
and pressEnter
.
Mac
- Press
Command + Space
to open Spotlight Search. - Type
Terminal
and pressEnter
.
C. Create virtual environment
Windows
cd path\to\your\project && python -m venv env && .\env\Scripts\activate
Mac
cd path/to/your/project && python3 -m venv env && source env/bin/activate
D. Install Open Humans module
pip install open-humans-api
E. Find the project code of a project
For instance the code for the first source project in the project with id 3 and name “Genetic Data” is “1989"
F. Run the downloader
Make a directory and run the open humans downloader. Replace 1989 with the project code.
mkdir directoryname
ohpub-download --source direct-sharing-1989 --directory directoryname