AnpherosAnpheros PlatformDevelopers

Health tracker API

Store steps, heart rate, HRV, sleep and SpO₂ from any wearable as LOINC-coded FHIR Observations: which devices reach which health store, why there is no web API, and working requests.

A health tracker API lets an application send and read the data that watches, rings, bands and scales collect — steps, heart rate, heart rate variability, sleep, oxygen saturation, weight — as structured data on a server. Most devices do not offer one shared API: their data reaches the phone's health store (Apple HealthKit or Android Health Connect), and your app reads it from there. Anpheros is the server side: your app writes the readings as LOINC-coded FHIR R4 Observations, and every other app, clinic or AI agent with the person's consent reads the same data through one API.

From a watch to your backend
  1. Watch, ring, scaleApple Watch, Galaxy Watch, Fitbit, Garmin, Oura, Withings
  2. Health store on the phoneApple HealthKit or Android Health Connect
  3. Your appReads with the person's permission, per local day
  4. FHIR ObservationsLOINC-coded steps, heart rate, sleep, SpO₂, weight
  5. Your backendOne API for every device, with history and consent

Which devices reach which health store

Device Reaches Read it with
Apple Watch, iPhone, many iOS apps Apple HealthKit Swift on the iPhone (Apple Health to FHIR)
Galaxy Watch, Wear OS, Fitbit, Garmin, Oura, Withings (Android apps) Android Health Connect Kotlin or Flutter on the phone (Health Connect to FHIR)
Galaxy Watch details not in Health Connect Samsung Health Samsung Health Data SDK (Samsung Health to FHIR)

Neither HealthKit nor Health Connect has a web or REST API: the data lives on the phone, and only an app the person installed and allowed can read it. A health tracker API on a server therefore always starts with a small mobile app.

What a health tracker API should store, coded
StepsLOINC 41950-7 · daily total, effectivePeriod = the day
Resting heart rateLOINC 40443-4 · beats per minute
Heart rate variabilityLOINC 80404-7 · RMSSD in ms
Oxygen saturationLOINC 59408-5 · percent
SleepLOINC 93832-4 duration; 93831-6 / 93830-8 stages
Active energyLOINC 41981-2 · kcal

Write one day of steps

curl -X POST https://platform.anpheros.com/fhir/R4/Observation \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/fhir+json" \
  -H "Idempotency-Key: steps-$PID-2026-10-15" \
  -d '{
    "resourceType": "Observation",
    "status": "final",
    "category": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "activity"}]}],
    "code": {"coding": [{"system": "http://loinc.org", "code": "41950-7", "display": "Number of steps in 24 hour Measured"}]},
    "subject": {"reference": "Patient/'"$PID"'"},
    "effectivePeriod": {"start": "2026-10-15T00:00:00+03:00", "end": "2026-10-16T00:00:00+03:00"},
    "valueQuantity": {"value": 8412, "unit": "steps", "system": "http://unitsofmeasure.org", "code": "{steps}"}
  }'

Store one Observation per metric per local day, with the person's time zone in the period. The Idempotency-Key makes a resend harmless. Wearable data in FHIR has the full LOINC table and a tested daily upsert.

Read it back

# the last 30 daily step counts
curl "https://platform.anpheros.com/fhir/R4/Observation?patient=$PID&code=http://loinc.org|41950-7&_sort=-date&_count=30" \
  -H "Authorization: Bearer $KEY"

Another application reads the same data only with the person's consent (OAuth 2.1, SMART scopes such as patient/Observation.rs?category=activity), and every read is logged where the person can see it.

Frequently asked questions

Is there a free health tracker API?

Anpheros has a free sandbox: store and read tracker data as FHIR Observations with 30 synthetic patients. Device makers' own APIs (Fitbit, Garmin, Oura, Withings) have their own access rules and terms.

Is there a web API for Apple Health or Health Connect?

No. HealthKit and Health Connect keep data on the phone; an installed app reads it with the person's permission and can send it to a server such as Anpheros.

Which codes should a health tracker API use?

LOINC: 41950-7 steps, 8867-4 heart rate, 40443-4 resting heart rate, 80404-7 heart rate variability (RMSSD), 59408-5 oxygen saturation, 93832-4 sleep duration, 29463-7 body weight. Units in UCUM.

Does Anpheros connect to Fitbit or Garmin directly?

No. Their data reaches Anpheros through the phone's health store and your app; there is no direct cloud-to-cloud connection.

Related