Skip to main content

stravacookies

stravacookies is a small python package providing a few classes for retrieving HTTP cookies from Strava web servers.

These cookies allow web browsers to get the high-resolution version of the Global Strava Heatmap. The very same cookies can also be used by cartographic applications (such as JOSM and Cartograph Maps) to get Strava Heatmap tiles via Tile Map Service (TMS).

Permission to use the hi-res Strava Heatmap in JOSM has been granted by Strava, see https://wiki.openstreetmap.org/wiki/Strava and https://wiki.openstreetmap.org/wiki/Permissions/Strava

How it works

Hi-res Gloval Strava Heatmap is available to Strava registered users only. When you click to https://www.strava.com/heatmap and login to Strava, your browser gets several cookies that it includes in later requests to be granted permission to download the hi-res tiles of the Strava Heatmap.

The authentication process consist of three steps:

  1. The user fills in the login form at https://strava.com/login.
  2. Upon submit, the browser sends a POST request to https://www.strava.com/session, email=<STRAVA_EMAIL>, password=<STRAVA_PASSWORD>, remember-me checkbox set, and in exchange it receives _strava4_session, strava_remember_id, and strava_remember_tokencookies from the server.
  3. The browser sends a GET request to https://heatmap-external-a.strava.com/auth with the previous session cookies set, and gets CloudFront-Signature, CloudFront-Policy, and CloudFront-Key-Pair-Id cookies from server.

The last three cookies are those needed to allow the browser to download the high-res heatmap tiles. Concatenating the cookie strings to the TMS URLs (as shown below) allows external applications (such as JOSM or Cartograph Maps) to download the hi-res tiles from Strava.

Example of a TMS URL that can be used in JOSM to get the hi-res version of the Strava Heatmap:

tms[3,15]:https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/run/hot/{zoom}/{x}/{y}.png?Key-Pair-Id=<YOUR_KEY_PAIR_ID_COOKIE_VALUE>&Policy=<YOUR_POLICY_COOKIE_VALUE>&Signature=<YOUR_SIGNATURE_COOKIE_VALUE>

Cookies expire, so it is necessary to re-login to Strava from time to time to get up to date cookies.

Requirements

To download all needed Strava cookies, a Strava account (email/password) is needed. Facebook/Google/Apple login to Strava is not supported. You can register to Strava at https://www.strava.com/register.

Licence

stravacookies is distributed under the GPL v3.0 licence.

Metadata

Release files for stravacookies 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stravacookies 1.3
File Size Uploaded Provenance
stravacookies-1.3.tar.gz 15.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for stravacookies 1.3
File Interpreter ABI Platform
stravacookies-1.3-py3-none-any.whl Python 3 none any Details

Total release size: 32.7 kB

Release files / stravacookies-1.3.tar.gz

Download URL stravacookies-1.3.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
47b7eb8e0ac09e8dea7ad7eb2d5f1302b9e2adbdcf9e63c805acd7b2c03ec911
BLAKE2b-256 checksum
How to use checksums
5b4e651437303c54993e2ac7ed7e9017397eb61f33b2982872b758ef67219dcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.6

Release files / stravacookies-1.3-py3-none-any.whl

Download URL stravacookies-1.3-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67124cb9f572cb94a91eedaca153d7d66740b7fb48a4bd8212a33024ff7d7e2c
BLAKE2b-256 checksum
How to use checksums
8785733fcea7cd357edf5845ccbd563602d6e0251ff7038edd67eae05864aeaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.6

Security for stravacookies 1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page