How to get health data from Open Humans

Kelvin Kramp
2 min readMay 30, 2024

--

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

  1. Go to the Python website.
  2. Download the latest Python installer for Windows.
  3. Run the installer and check “Add Python to PATH”.
  4. Click “Install Now”.

Mac

  1. Go to the Python website.
  2. Download the latest Python installer for macOS.
  3. Open the downloaded .pkg file.
  4. Follow the on-screen instructions to complete the installation

B. Open terminal

Windows

  1. Press Windows + R to open the Run dialog.
  2. Type cmd and press Enter.

Mac

  1. Press Command + Space to open Spotlight Search.
  2. Type Terminal and press Enter.

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

--

--