Step Counting API: How to Get Step Data
Updated July 24, 2026
Step counts are one of the most widely available fitness metrics, because the phone itself can count them — no wearable required. You get step data two ways: from an on-device store (Apple HealthKit on iOS, Android Health Connect on Android, or Core Motion's live pedometer on iOS) or from a cloud wearable API (Garmin, Fitbit, Samsung Health, Withings, and others) after the user's device syncs. Steps are counted, but algorithmically — derived from motion-sensor pattern recognition, not a literal foot-fall sensor — so treat them as a close estimate, not ground truth. Best pick: for the widest reach with the least friction, read the on-device platform store so you inherit the OS's own multi-source de-duplication; add a cloud or aggregator source only when you need server-side data without the user's phone in the loop. (For how on-device stores differ from cloud APIs, see on-device vs cloud health data.)
Where you can get steps
Steps are available from a phone alone (its pedometer) as well as from wearables. Provider-specific field names, records, and device coverage change often, so treat this table as a starting point and confirm against each vendor's live data dictionary (as of 2026, verify).
| Source | How you access it | Notes |
|---|---|---|
| Apple HealthKit (iOS) | On-device read with per-type permission; no cloud pull | HKQuantityTypeIdentifier.stepCount. HealthKit aggregates and de-duplicates across sources when you query statistics |
| Core Motion (iOS) | On-device pedometer via CMPedometer | Live, low-level phone pedometer, separate from HealthKit; verify exact fields in Apple's Core Motion docs |
| Android Health Connect | On-device read with per-record permission; no cloud pull | StepsRecord (count, startTime, endTime, zone offsets); primary aggregation is StepsRecord.COUNT_TOTAL |
| Garmin Health API | Cloud OAuth 2.0 (post-sync) | Steps listed among daily/interval summary metrics; verify current fields |
| Fitbit / Samsung Health / Polar / Withings | Cloud OAuth 2.0 (post-sync) | Each exposes daily or interval step summaries via its own API |
| Aggregators (Terra, Junction, Rook) | One normalized schema over many providers | All normalize steps (Terra day-level summaries include steps); see wearable data APIs |
Measured or estimated?
Steps are counted, but the count comes from motion-sensor pattern-recognition algorithms interpreting accelerometer data, not from a sensor that registers each literal foot-fall. Treat step counts as algorithmic and close, not exact, and do not attach an accuracy percentage — none is sourced, and figures vary by device, gait, and where the device is carried. This is wellness-grade activity data, not a clinical measurement.
The headline gotcha is double-counting across a phone and a paired watch. When a user carries a phone and wears a watch, both log steps, so a naive sum roughly doubles the total. The platforms provide de-duplication, and you should lean on it rather than summing raw samples yourself:
- Health Connect: use
aggregate()(for exampleStepsRecord.COUNT_TOTAL) rather than summing rawreadRecords(). Be aware that attribution can span multipleDataOriginpackage names, and that on-device step attribution changed in 2026 — legacy readings attributed to the"android"package versus a newer device Synthetic Package Name. Read and verify the current Health Connect steps guidance before you filter or de-duplicate by origin. - HealthKit: it de-duplicates across sources when you query statistics rather than raw samples. Verify the current behavior in Apple's HealthKit docs before assuming a given query already merges phone and watch.
Because both platforms already reconcile multiple sources, the safest design is to read the aggregated total the OS gives you instead of stitching sources together by hand.
Which source should you pick?
- Widest reach, least friction: read the on-device platform store — HealthKit
HKQuantityTypeIdentifier.stepCounton iOS, Health ConnectStepsRecordon Android — so you inherit the OS's own multi-source de-duplication and avoid the double-counting trap. See the setup guides for HealthKit and Google Health Connect. - Live, in-the-moment step count on iOS: Core Motion's
CMPedometergives you low-level pedometer data directly, separate from HealthKit's stored samples. - Server-side without the phone present: a cloud wearable API (Garmin, Fitbit, Samsung Health, and others) delivers daily or interval step summaries after the device syncs — useful when your backend needs the data and the user's phone is not in the loop.
- Many brands at once: an aggregator (Terra, Junction, Rook) hands you one normalized steps schema instead of N integrations.
Before you ship
Field names, records, aggregation methods, and device coverage are volatile — re-verify each against the vendor's current data dictionary as of 2026. In particular, confirm the 2026 Health Connect step-attribution change before shipping any de-duplication logic. Prefer the platform's aggregated total over hand-summed sources to avoid phone-plus-watch double-counting, and frame step counts as an algorithmic wellness signal rather than an exact measurement.
Frequently asked questions
- Can a phone count steps without a wearable?
- Yes. Step counting is one of the few fitness metrics fully available from a phone alone - its accelerometer feeds a pedometer. On iOS you can read stored counts via HealthKit (HKQuantityTypeIdentifier.stepCount) or live data via Core Motion's CMPedometer; on Android you read Health Connect's StepsRecord. A wearable only adds coverage for times the phone is not carried. As of 2026, verify exact fields in each platform's data dictionary.
- Why do my step counts look doubled?
- Because a phone and a paired watch both log steps, so naively summing every source roughly doubles the total. Use the platform's de-duplication instead: on Android, use Health Connect's aggregate() (for example StepsRecord.COUNT_TOTAL) rather than summing raw readRecords(); on iOS, query HealthKit statistics, which de-duplicate across sources. Read the aggregated total the OS provides rather than stitching sources together yourself.
- Are step counts measured or estimated?
- They are counted, but algorithmically - motion-sensor pattern recognition interpreting accelerometer data, not a sensor that registers each literal foot-fall. Treat step counts as a close algorithmic estimate, not ground truth, and do not rely on an exact accuracy figure; accuracy varies by device, gait, and where the device is carried. It is wellness-grade activity data, not a clinical measurement.
- Did Health Connect change how steps are attributed in 2026?
- There is a reported 2026 change to on-device step attribution in Health Connect - legacy readings attributed to the "android" package versus a newer device Synthetic Package Name - which affects how you filter or de-duplicate by DataOrigin. Confirm the current Health Connect steps guidance before shipping any de-duplication logic, as this behavior is volatile; verify in the official docs.
- Which source should I use for step data?
- For the widest reach with least friction, read the on-device platform store (HealthKit on iOS, Health Connect on Android) so you inherit the OS's multi-source de-duplication. Use Core Motion's CMPedometer for live counts on iOS. Use a cloud wearable API (Garmin, Fitbit, Samsung Health) when your backend needs data without the user's phone present, or an aggregator to normalize many brands at once.
Keep reading
Independent comparison, last reviewed July 24, 2026. Pricing, rate limits, and feature availability change often — confirm current details in each provider’s official documentation before you commit. Product and company names are trademarks of their respective owners; AIFitnessAPI is not affiliated with, endorsed by, or sponsored by any product listed here.
← All health data · by AIFitnessAPI