Skip to content
AF
Health Data

GPS Activity API: How to Get Route Data from Workouts

Last verified July 24, 2026 · 5 min read

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.

Covered here:StravaGarminHealth ConnectHealthKitTerraJunction

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.

Strava routes: what the API calls reach#

Strava keeps routes, the courses an athlete plans, separate from the activities they record. We could not reach Strava's developer site on October 12, 2026 to re-read its reference, so this section reports what stravalib, the Python client for the Strava API, wraps on its main branch as read that day:

  • List an athlete's routes: get_routes, which calls /athletes/{id}/routes and defaults to the authenticated athlete.
  • Get one route: get_route, which calls /routes/{id}. Its docstring says the result is detail-level when the authenticated athlete owns the route and summary-level otherwise.
  • Get a route's streams: get_route_streams, which calls /routes/{id}/streams. Its docstring says external applications may read streams for all public routes and for the authenticated athlete's private routes, and that the three route stream types, distance, altitude and latlng, are always returned.

None of these calls suggests or generates a route: they read routes an athlete already has. Whether Strava offers a route-suggestion endpoint we could not check against Strava's own reference, so confirm it there before you design around one. The display and data-combination terms above apply to route data as much as to activities.

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.

GPS location, by platform

Each type links its reference page on this site. The quote is the platform's own description of the type, copied from the generated reference data, and it is the reason the type is listed: nothing here is paired by name. A platform with nothing listed has no type with a page here whose description names this metric.

Google Health API · read 2026-10-17

Nothing listed.

Apple HealthKit · read 2026-10-02

Nothing listed.

Android Health Connect · read 2026-10-03

Nothing listed.

Wear OS Health Services · read 2026-10-04

  • DataType.LOCATION — DeltaDataType · SampleDataPoint<LocationData> · permission ACCESS_FINE_LOCATION
    “Latitude, longitude and optionally, altitude and bearing at a specific point in time.” — Google

Bluetooth GATT · read 2026-10-17

Nothing listed.

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.

All 132 questions in Health Data →

Keep reading

Elsewhere on the site

Pages that share this one’s concepts and sources, from other sections.

Next steps

Was this page useful?

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