Skip to content
AFAIFitnessAPI
Health Data

GPS Activity API: How to Get Route Data from Workouts

Updated July 24, 2026

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.

GPS activity data — the route a user ran, rode, or walked — comes from two kinds of source: an on-device store (Apple HealthKit HKWorkoutRoute on iOS, Android Health Connect ExerciseRoute on Android) or a cloud wearable/activity API (Strava, Garmin) after the user's device syncs. The coordinates are measured by the device's GNSS/GPS, but they are noisy — subject to drift and smoothing — and any distance is a computation over those imperfect points. Best pick: for showing a user their own route, the on-device path (HKWorkoutRoute / ExerciseRoute) is the least restrictive; for pulling routes server-side across many users, Garmin's Activity API ships standard file formats; use Strava only after confirming its display and usage restrictions fit your product. (For workout sessions themselves, see workout detection; for the broader landscape, see wearable data APIs.)

Where you can get GPS route data

Route data can come from a phone (which has GPS) or a GPS-capable watch or bike computer; a non-GPS wearable relies on the connected phone's location. All provider-specific fields, formats, and terms change often, so treat this table as a starting point and confirm against each vendor's live data dictionary (as of 2026, verify).

SourceHow you access itNotes
Apple HealthKit (iOS)On-device read with per-type permission plus OS location permission; no cloud pullHKWorkoutRoute (route attached to a workout), read via HKWorkoutRouteQuery, built via HKWorkoutRouteBuilder
Android Health ConnectOn-device read with per-record permission plus location permission; no cloud pullExerciseRoute — a sequence of ExerciseRoute.Location points tied to an exercise session, not an independent record. Google advises filtering low-accuracy GPS samples and using a foreground service when recording
Strava APICloud OAuth 2.0 (post-sync)Streams are the raw time-series for an activity/segment (GPS lat/lng, altitude, and more), documented as 11 stream types, all equal length and index-aligned; Routes can export to GPX/TCX. Display and usage restrictions apply — see below. See Strava API
Garmin Activity APICloud OAuth 2.0 (post-sync)Delivers captured activity files in .FIT/GPX/.TCX with full route detail. See Garmin API
Aggregators (Terra, Junction, Rook)One normalized schema over many providersTerra lists GPS routes among workout data — verify the current source list in its own docs

Measured or estimated?

GPS coordinates are measured by the device's GNSS receiver — this is real positional data, not a model. But the measurement is noisy: it is subject to accuracy error, drift near buildings or tree cover, and vendor smoothing. That is exactly why Health Connect tells you to filter low-accuracy samples before writing a route. Distance and pace derived from a route are computations over those noisy points, so two apps can report slightly different distances for the same activity. Never quote a positional-accuracy number — accuracy varies by device, sky view, and conditions.

The Strava restriction trap (verify current terms)

Strava is the biggest gotcha on this page, and it is a terms problem, not a technical one:

  • Rate limits and tightening access. Strava enforces API rate limits and has been narrowing access. For example, the Explore Segments endpoint is documented as moving to an approved "Extended Access" tier, per the Strava changelog (effective date around Sept 2026 — verify current status in the Strava changelog).
  • Display and data-combination rules. Strava's API Agreement restricts how its data may be displayed and combined with other providers' data. Common designs — such as merging Strava routes with other sources onto one map — can be blocked by these terms.

Because these terms change and can quietly break a feature after you have built it, treat all Strava display and combination rules as "verify in the current Strava API Agreement" before you commit to a design. Confirm the current status of any endpoint tier and the brand/display rules directly with Strava.

Which source should you pick?

  • Showing a user their own route (least restrictive): the on-device path — HKWorkoutRoute on iOS, ExerciseRoute on Android. You read it in-app with location permission, no cloud terms to navigate, and no post-sync latency.
  • Pulling routes server-side across many users: Garmin's Activity API is straightforward because it hands you standard file formats (.FIT/GPX/.TCX) with full route detail.
  • Strava-specific data (segments, athlete activities): use it only after confirming its display and usage restrictions fit your product; do not assume you can combine it freely with other sources.
  • Many brands at once: an aggregator (Terra, Junction, Rook) normalizes GPS routes into one schema across providers — but you inherit each underlying provider's terms, Strava's included.

Before you ship

Route fields, export formats, endpoint access tiers, and API terms are volatile — re-verify each against the vendor's current data dictionary and agreement as of 2026. Filter low-accuracy GPS samples before you store or draw a route, never publish a positional-accuracy figure, and treat Strava's display and data-combination rules as the item most likely to block your design. When you need location permission plus on-device stores versus a cloud pull, see on-device vs cloud health data.

Frequently asked questions

Is GPS route data measured or estimated?
The coordinates are measured by the device's GNSS/GPS receiver, not modeled. But the measurement is noisy: it drifts near buildings or tree cover and is subject to vendor smoothing, which is why Health Connect advises filtering low-accuracy samples before writing a route. Any distance or pace derived from the route is a computation over those imperfect points, so figures can differ slightly between apps. Never publish a positional-accuracy number; accuracy varies by device and conditions.
Can I get GPS route data from a phone without a wearable?
Yes. A phone has GPS, so it can record a route on its own, and a GPS-capable watch or bike computer can too. A non-GPS wearable relies on the connected phone's location. On-device recording needs the OS location permission, and Google recommends a foreground service when capturing a route on Android.
What are Strava's API restrictions for route data?
Strava enforces rate limits and has been tightening access; for example the Explore Segments endpoint is documented as moving to an approved Extended Access tier per the Strava changelog. Its API Agreement also restricts how Strava data may be displayed and combined with other providers' data, which can block common designs like merging Strava routes with other sources onto one map. These terms change, so verify the current Strava API Agreement before you build.
Which API is best for GPS route data?
To show a user their own route, the on-device path is least restrictive: HKWorkoutRoute on iOS, ExerciseRoute on Android. To pull routes server-side across many users, Garmin's Activity API is straightforward because it delivers standard .FIT, GPX, and .TCX files. Use Strava only after confirming its display and data-combination restrictions fit your product. To combine many brands, an aggregator like Terra, Junction, or Rook normalizes routes, but you inherit each provider's terms.
How do HealthKit and Health Connect expose route data?
On iOS, HealthKit stores a route as HKWorkoutRoute attached to a workout; you read it with HKWorkoutRouteQuery and build it with HKWorkoutRouteBuilder. On Android, Health Connect exposes ExerciseRoute, a sequence of ExerciseRoute.Location points tied to an exercise session rather than an independent record. Both are on-device reads that require the OS location permission. Verify exact field names in each platform's data dictionary.

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