Athlete Heatmaps

Athlete heatmaps can be generated for any date range and set of activity types. The result is a set of tiles and some meta data. The tiles are to be displayed over a map, such as Google’s.

Summary and detailed representation attributes   

id: integer
resource_state: integer
indicates level of detail
athlete: object
meta representation of the athlete
created_at: time string
linked with strava
updated_at: time string
uploaded to instagram
activity_type_ids: array of integer
activities_count: integer
tiles_count: integer
center_latlng: [latitude, longitude]
center_zoom: integer
tile_path: string
base path for tiles, should follow with /{z}/{x}/{y}.png
status: string
only included in progress response
possible values of: ‘queued’, ‘building’, ‘gathering’, ‘generating’,’done’,’error’
status_message: string
only included in progress response
english message corresponding to the status
web_url: string
map on the web
start_date_local: time string optional
end_date_local: time string optional

Heatmaps include only public activities and privacy zones are respected. The heatmap ID is random and acts as a layer of security. Thus the map can only be viewed if shared.

Example Heatmap

{
  "id": 717833605,
  "resource_state": 3,
  "athlete": {
    "id": 123,
    "resource_state": 1
  },
  "created_at": "2014-05-09T19:22:57Z",
  "updated_at": "2014-05-12T23:32:15Z",
  "activity_type_ids": [
    1,
    9
  ],
  "activities_count": 256,
  "tiles_count": 6939,
  "center_latlng": [
    38.548165423046584,
    -121.9921875
  ],
  "center_zoom": 9,
  "tile_path": "http://tileserver.com/01000EC02AC94585-5C62DDDD",
  "web_url": "http://strava.com/athletes/123/heatmaps/2ac94585",
  "start_date_local": "2013-01-01T00:00:00Z",
  "end_date_local": "2014-01-01T00:00:00Z"
}

 

List athlete heatmaps

Parameters

None

Returns an array of heatmap summary objects.

Definition

GET https://www.strava.com/api/v3/athlete/heatmaps

Example request

$ curl -G https://www.strava.com/api/v3/athlete/heatmaps \
    -H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9"

Example response

[
  {
    "id": 717833605,
    "resource_state": 2,
    "athlete": {
      "id": 123,
      "resource_state": 1
    },
    "created_at": "2014-05-09T19:22:57Z",
    "updated_at": "2014-05-12T23:32:15Z",
    "activity_type_ids": [
      1
    ],
    "activities_count": 256,
    "tiles_count": 6939,
    "center_latlng": [
      38.548165423046584,
      -121.9921875
    ],
    "center_zoom": 9,
    "tile_path": "http://tileserver.com/01000EC02AC94585-5C62DDDD",
    "web_url": "http://strava.com/athletes/123/heatmaps/2ac94585"
  }
]

 

Generate a heatmap

Parameters

activity_type_ids: string required
comma separated list
start_date_local: integer
seconds since epoch to be used with activity.start_date_local
end_date_local: integer
seconds since epoch to be used with activity.end_date_local

Returns a subset of the heatmap summary object. Just those elements that are relevant.

Definition

POST https://www.strava.com/api/v3/athlete/heatmaps

Example request

$ curl -X POST https://www.strava.com/api/v3/athlete/heatmaps \
    -H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9"
    -F "activity_type_ids=1,9"
    -F "start_date_local=123123123"
    -F "end_date_local=123123999"

Example response

{
  "id": 485794903,
  "resource_state": 3,
  "athlete": {
    "id": 123,
    "resource_state": 1
  },
  "activity_type_ids": [
    1
  ],
  "web_url": "http://strava.com/athletes/123/heatmaps/2ac94585"
}

 

Retrieve generate progress

Heatmap generation is an asynchronous process and is dependent on the number of activities. This endpoint can be used to check progress.

Parameters

athlete_id: integer required
map_id: integer required

The response includes a status and english status_message.

Definition

GET https://www.strava.com/api/v3/athletes/:athlete_id/heatmaps/:map_id/progress

Example response

{
  "id": 1776508959,
  "resource_state": 3,
  "athlete": {
    "id": 123,
    "resource_state": 1
  },
  "activity_type_ids": [
    1
  ],
  "web_url": "http://strava.com/athletes/123/heatmaps/69e3601f",
  "status": "generating",
  "status_message": "Generating Tiles (744 of 6939)"
}

 

Retrieve a heatmap

Parameters

athlete_id: integer required
map_id: integer required

Returns a heatmap detailed object.

Definition

GET https://www.strava.com/api/v3/athletes/:athlete_id/heatmaps/:map_id

Example response

{
  "id": 717833605,
  "resource_state": 2,
  "athlete": {
    "id": 123,
    "resource_state": 1
  },
  "created_at": "2014-05-09T19:22:57Z",
  "updated_at": "2014-05-12T23:32:15Z",
  "activity_type_ids": [
    1
  ],
  "activities_count": 256,
  "tiles_count": 6939,
  "center_latlng": [
    38.548165423046584,
    -121.9921875
  ],
  "center_zoom": 9,
  "tile_path": "http://tileserver.com/01000EC02AC94585-5C62DDDD",
  "web_url": "http://strava.com/athletes/123/heatmaps/2ac94585"
}

 

Delete a heatmap

Parameters

athlete_id: integer required
map_id: integer required

Returns 204 No Content on success

Definition

DELETE https://www.strava.com/api/v3/athletes/:athlete_id/heatmaps/:map_id