Skip to content

danvaneijck/renpho-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

renpho-api

PyPI CI Python

Unofficial Python client for the Renpho Health API. Pull body composition measurements from Renpho smart scales programmatically.

Based on reverse-engineering from RenphoGarminSync-CLI.

Installation

pip install renpho-api

For .env file support (recommended for CLI usage):

pip install "renpho-api[dotenv]"

CLI Usage

  1. Create a .env file (or export the variables):
RENPHO_EMAIL=your@email.com
RENPHO_PASSWORD=your_plain_text_password
  1. Run the CLI:
renpho

This will log in, discover your scales, fetch all measurements, print the 5 most recent, and save everything to renpho_data/ as JSON and CSV.

Environment variables

Variable Required Description
RENPHO_EMAIL Yes Your Renpho account email
RENPHO_PASSWORD Yes Your Renpho account password
RENPHO_DEBUG No Set to 1 to print API request/response details
RENPHO_OUTPUT_DIR No Output directory (default: renpho_data)

Library Usage

from renpho import RenphoClient

client = RenphoClient("user@example.com", "password")
client.login()

# Fetch all measurements in one call
measurements = client.get_all_measurements()

for m in measurements:
    print(m["weight"], m.get("bodyfat"), m.get("muscle"))

Step-by-step control

from renpho import RenphoClient, save_json, save_csv

client = RenphoClient("user@example.com", "password")
client.login()

# Get device/scale info
device_info = client.get_device_info()
scales = device_info["scale"]

# Fetch from a specific scale table
table = scales[0]
measurements = client.get_measurements(
    table_name=table["tableName"],
    user_id=client.user_id,
    total_count=table["count"],
)

# Export
save_json(measurements, "my_data.json")
save_csv(measurements, "my_data.csv")

Error handling

from renpho import RenphoClient, RenphoAPIError

client = RenphoClient("user@example.com", "wrong_password")
try:
    client.login()
except RenphoAPIError as e:
    print(f"API error: {e}")

Available Metrics

Each measurement dict can contain these fields (availability depends on your scale model):

Key Description Unit
weight Weight kg
bmi BMI
bodyfat Body Fat %
water Body Water %
muscle Muscle Mass %
bone Bone Mass %
bmr Basal Metabolic Rate kcal/day
visfat Visceral Fat level
subfat Subcutaneous Fat %
protein Protein %
bodyage Body Age years
sinew Lean Body Mass kg
fatFreeWeight Fat Free Weight kg
heartRate Heart Rate bpm
cardiacIndex Cardiac Index
bodyShape Body Shape

Project Structure

renpho-api/
├── pyproject.toml        # Package config & dependencies
├── README.md
├── renpho/
│   ├── __init__.py       # Public API exports
│   ├── client.py         # RenphoClient class
│   ├── cli.py            # CLI entry point
│   ├── constants.py      # API endpoints, device types, metrics
│   ├── crypto.py         # AES encryption/decryption
│   └── export.py         # JSON/CSV export helpers
├── tests/                # Unit tests
└── .github/workflows/    # CI + PyPI release automation

About

Python API to fetch your health data from Renpho

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages