---
title: "Health Data"
canonical: "https://aifitnessapi.com/data"
type: "cluster-index"
pages: "14"
last_reviewed: "2026-08-12"
publisher: "AIFitnessAPI"
---

# Health Data

> 14 pages. Each entry below shows the question the page owns, followed by its answer capsule.

## Heart Rate API: How to Get Heart-Rate Data Into Your App

- Question: heart rate api
- HTML: https://aifitnessapi.com/data/heart-rate-api
- Markdown: https://aifitnessapi.com/data/heart-rate-api.md
- Last reviewed: 2026-07-24

Heart rate is a measured signal, read on consumer devices from a PPG optical sensor (chest straps use electrical ECG-style sensing). You get it into an app from on-device stores (Apple HealthKit `HKQuantityTypeIdentifierHeartRate`, Android Health Connect `HeartRateRecord`), from nearly every wearable cloud API (Fitbit, Garmin, Oura, WHOOP, Strava), or from an aggregator that normalizes all of them. HR itself is measured and wellness-grade, not an ECG or diagnostic; resting and walking-average HR are derived aggregates. Best pick: on-device or a chest strap for live in-workout HR, and cloud OAuth or an aggregator for all-day and resting HR across many devices.

## HRV API: How to Get Heart Rate Variability Data

- Question: hrv api
- HTML: https://aifitnessapi.com/data/hrv-api
- Markdown: https://aifitnessapi.com/data/hrv-api.md
- Last reviewed: 2026-07-24

HRV is a measured metric from the timing between heartbeats. You read it on-device (Apple HealthKit stores SDNN via HKQuantityTypeIdentifierHeartRateVariabilitySDNN; Android Health Connect gives RMSSD via HeartRateVariabilityRmssdRecord) or from cloud wearable APIs (Oura, WHOOP, Garmin, Fitbit) after sync. It reflects parasympathetic activity, so treat it as a wellness signal, not a stress or recovery measurement. Best pick: Oura or WHOOP for ready-made recovery scoring, Health Connect for a raw RMSSD trend on Android, a chest strap for real-time.

## VO2 Max API: How to Get VO2 Max Data

- Question: vo2 max api
- HTML: https://aifitnessapi.com/data/vo2-max-api
- Markdown: https://aifitnessapi.com/data/vo2-max-api.md
- Last reviewed: 2026-07-24

You get VO2 max by reading an on-device store (Apple HealthKit HKQuantityTypeIdentifierVO2Max, Android Health Connect Vo2MaxRecord) or by pulling a cloud wearable API (Garmin User Metrics, Fitbit's Cardio Fitness Score, Oura) over OAuth 2.0. Be honest that consumer VO2 max is estimated, not lab-measured: it is modeled from heart-rate response versus pace or power plus demographics, so it is a fitness-trend signal, not a clinical value. Not every provider exposes it and coverage is device-dependent. Best pick: HealthKit for Apple apps, Garmin or Fitbit for a cross-device trend, and an aggregator when you mix brands.

## Blood Oxygen (SpO2) API: How to Get SpO2 Data

- Question: blood oxygen spo2 api
- HTML: https://aifitnessapi.com/data/blood-oxygen-api
- Markdown: https://aifitnessapi.com/data/blood-oxygen-api.md
- Last reviewed: 2026-07-24

Blood oxygen (SpO2) is measured by optical pulse oximetry on wrist wearables and finger rings, but on consumer devices it is a general-wellness signal, not an FDA-cleared diagnostic. You can read it from on-device stores (HealthKit oxygenSaturation, Health Connect OxygenSaturationRecord) or cloud wearable APIs (Fitbit, Garmin, Oura, WHOOP), most of which report an overnight trend rather than continuous daytime readings. Best pick: Oura, Fitbit, or Garmin for overnight trends; HealthKit for an on-demand iOS spot check, subject to Apple Watch US availability caveats.

## Sleep Tracking API: How to Get Sleep Data Into Your App

- Question: sleep tracking api
- HTML: https://aifitnessapi.com/data/sleep-tracking-api
- Markdown: https://aifitnessapi.com/data/sleep-tracking-api.md
- Last reviewed: 2026-07-24

Sleep data comes from devices worn overnight (Oura, WHOOP, Fitbit, Garmin, Apple Watch) via on-device stores (HealthKit's HKCategoryTypeIdentifierSleepAnalysis, Health Connect's SleepSessionRecord) or cloud OAuth APIs. Duration is measured reasonably well, but sleep stages are estimated from motion and heart rate and each vendor labels them differently. Best pick: Oura or WHOOP for rich staging plus readiness, or an aggregator to reconcile several brands.

## Step Counting API: How to Get Step Data

- Question: step counting api
- HTML: https://aifitnessapi.com/data/step-counting-api
- Markdown: https://aifitnessapi.com/data/step-counting-api.md
- Last reviewed: 2026-07-24

Step counts are widely available because the phone itself can count them - no wearable needed. You get them from an on-device store (Apple HealthKit's stepCount, iOS Core Motion CMPedometer, or Android Health Connect's StepsRecord) or from a cloud wearable API (Garmin, Fitbit, Samsung Health) after the device syncs. Steps are counted, but algorithmically from motion sensors, so treat them as a close estimate rather than exact. Best pick: read the on-device platform store so you inherit the OS's own de-duplication - which matters because a phone plus a paired watch will otherwise double-count.

## Workout Detection API: Get Recorded Workout Sessions

- Question: workout detection api
- HTML: https://aifitnessapi.com/data/workout-detection-api
- Markdown: https://aifitnessapi.com/data/workout-detection-api.md
- Last reviewed: 2026-07-24

A workout detection API gets you recorded workout sessions with start time, end time, and activity type. You read them on-device (Apple HealthKit HKWorkout on iOS, Android Health Connect ExerciseSessionRecord on Android) or from a cloud activity API (Strava, Garmin, Fitbit) after the device syncs. Some vendors auto-detect activity (Fitbit SmartTrack) while others expect a manual start; duration is measured but activity type is inferred. Best pick: for automatic capture, a wearable that auto-detects; to read what the user already logged, the on-device store.

## GPS Activity API: How to Get Route Data from Workouts

- Question: gps activity route api
- HTML: https://aifitnessapi.com/data/gps-activity-api
- Markdown: https://aifitnessapi.com/data/gps-activity-api.md
- Last reviewed: 2026-07-24

GPS route data comes from an on-device store (Apple HealthKit HKWorkoutRoute on iOS, Android Health Connect ExerciseRoute on Android) or a cloud activity API (Strava streams, Garmin Activity API) after the device syncs. The coordinates are measured by the device's GPS/GNSS but are noisy, so filter low-accuracy samples and never quote a positional-accuracy figure. Best pick: on-device routes (HKWorkoutRoute / ExerciseRoute) to show a user their own route; Garmin's Activity API for server-side pulls across users; Strava only after confirming its display and data-combination restrictions.

## Calorie Tracking API: How to Get Calorie Data

- Question: calorie tracking api
- HTML: https://aifitnessapi.com/data/calorie-tracking-api
- Markdown: https://aifitnessapi.com/data/calorie-tracking-api.md
- Last reviewed: 2026-07-24

Calorie tracking is two different problems. Calories burned is a modeled estimate, not a measurement: read it on-device (Apple HealthKit activeEnergyBurned and basalEnergyBurned; Android Health Connect ActiveCaloriesBurnedRecord and TotalCaloriesBurnedRecord) or from cloud wearable APIs after sync. Calories consumed never comes from a wearable and needs a dedicated nutrition API such as Nutritionix or Edamam. Best pick: read the on-device energy types for burn and pair a nutrition API for intake. Both burn figures are estimates that differ across devices.

## Body Composition API: Weight, Body Fat, and Lean Mass Data

- Question: body composition api
- HTML: https://aifitnessapi.com/data/body-composition-api
- Markdown: https://aifitnessapi.com/data/body-composition-api.md
- Last reviewed: 2026-07-24

Body composition (weight, body fat %, BMI, lean mass) mostly does not come from wearables. A wrist band or watch cannot measure body fat or lean mass; those need a smart scale (bioimpedance) or manual entry, and BMI is computed from weight and height. You read the results on-device (Apple HealthKit bodyMass, bodyFatPercentage, bodyMassIndex, leanBodyMass; Android Health Connect WeightRecord, BodyFatRecord) or from a scale vendor's cloud API like Withings or Garmin via OAuth. Best pick: integrate a smart scale such as Withings for a full breakdown, or read whatever a paired scale wrote into HealthKit or Health Connect for a hardware-agnostic path. Weight measured, BMI computed, body fat and lean mass estimated.

## Menstrual Cycle API: How to Get Cycle Tracking Data

- Question: menstrual cycle api
- HTML: https://aifitnessapi.com/data/menstrual-cycle-api
- Markdown: https://aifitnessapi.com/data/menstrual-cycle-api.md
- Last reviewed: 2026-08-12

Menstrual cycle data is almost entirely user-logged rather than sensor-measured, so the real question is where the log lives and who may read it. On iOS you read Apple HealthKit's Reproductive Health category types - HKCategoryTypeIdentifierMenstrualFlow plus cervicalMucusQuality, ovulationTestResult, intermenstrualBleeding and others - and on Android you read Health Connect's Cycle Tracking records such as MenstruationFlowRecord, MenstruationPeriodRecord, CervicalMucusRecord and OvulationTestRecord. Cloud coverage is thin: among the sources documented on our pages, only Terra normalizes a menstruation datatype, so verify any other vendor directly. Best pick: the on-device platform stores, keeping the log on the device wherever the feature allows, because this category carries privacy stakes ordinary fitness metrics do not.

## Blood Glucose API: How to Get Glucose Data Into Your App

- Question: blood glucose api
- HTML: https://aifitnessapi.com/data/blood-glucose-api
- Markdown: https://aifitnessapi.com/data/blood-glucose-api.md
- Last reviewed: 2026-08-12

Blood glucose reaches your app second-hand: a fingerstick meter or a continuous glucose monitor measures it and its companion app writes it into the platform store, which you then read on-device via Apple HealthKit's HKQuantityTypeIdentifierBloodGlucose or Android Health Connect's BloodGlucoseRecord. The value is genuinely measured, but not all glucose is the same measurement - Health Connect requires a specimenSource field distinguishing interstitial fluid from capillary blood, plasma, serum, tears, or whole blood. The two traps that bite hardest are units, since samples may be in mg/dL or mmol/L by region, and meal context, which Health Connect makes mandatory and Apple exposes only as optional metadata. Best pick: the on-device stores for a single platform, or an aggregator such as Terra, Rook, or Spike server-side - and keep the framing wellness, not medical guidance.

## Blood Pressure API: How to Read BP Data In Your App

- Question: blood pressure api
- HTML: https://aifitnessapi.com/data/blood-pressure-api
- Markdown: https://aifitnessapi.com/data/blood-pressure-api.md
- Last reviewed: 2026-08-12

Blood pressure reaches an app through the two on-device stores, not through a wearable feed. Apple HealthKit splits it into the quantity types bloodPressureSystolic and bloodPressureDiastolic and asks you to combine them into a single correlation, HKCorrelationTypeIdentifier.bloodPressure. Android Health Connect uses one BloodPressureRecord in the Vitals category, where systolic, diastolic, bodyPosition, and measurementLocation are all mandatory fields. It is a real measurement, but the instrument is a cuff outside your app: both platforms also expose a write permission, so a stored value may have come from a monitor's companion app or from a person typing. Our pages document no consumer wearable that measures blood pressure, so verify any device claim against that vendor's own documentation and regulatory record.

## Respiratory Rate API: How to Get Breathing-Rate Data

- Question: respiratory rate api
- HTML: https://aifitnessapi.com/data/respiratory-rate-api
- Markdown: https://aifitnessapi.com/data/respiratory-rate-api.md
- Last reviewed: 2026-08-12

Respiratory rate is exposed as a bare number on both mobile platforms. Apple HealthKit defines HKQuantityTypeIdentifier.respiratoryRate as discrete samples in count over time units, and states that the system records them automatically on Apple Watch. Android Health Connect defines RespiratoryRateRecord in the Vitals category with only rate, time, and metadata, where rate is breaths per minute with a valid range of 0 to 1000. Neither type carries a method or provenance field, so the store cannot tell you whether a value came from a wearable algorithm, a medical device, or someone typing. On our pages, Oura returns respiratory rate inside its sleep payload and Fitbit documents a respiratory_rate OAuth scope; other vendors are not documented here, so verify them.
