Export your own rides from OnelapFit / Geoid (the international app for
Magene bike computers) as raw .FIT files — no Strava, no cloud middleman.
Strava restricted its API to paid subscribers in 2026. If your head unit
(Magene / Geoid) syncs to onelap.com, this tool pulls the original .FIT
files directly from OnelapFit's fitness backend so you can own, back up, or
re-import them anywhere:
- intervals.icu — drag-and-drop or watched-folder import
- Golden Cheetah
- statistics-for-strava (file-import mode)
- or just a plain backup folder you control
Not the Chinese edition. This targets the international backend
api-fitness.rfsvr.combehind youronelap.comaccount.onelap.cnis a separate service and is not supported.
- Zero dependencies — Python 3.8+ standard library only. One file.
- Incremental — remembers what it already fetched (state file); only new rides download.
- Integrity-checked — validates the
.FITsignature and the header-declared length, so a truncated/expired download never lands in your folder. - Resilient — retries transient network / 5xx / 429 errors with backoff.
- Config-driven — nothing is hard-coded to any user; point it at any output folder.
- Optional post-hook — run any command after new files arrive (notify, trigger an import, ...).
git clone https://github.com/<you>/onelap-fit-export.git
cd onelap-fit-export
cp config.example.ini config.ini
$EDITOR config.ini # fill in your onelap.com account + passwordNo pip install needed.
# one-off / incremental sync
python3 onelap_fit_export.py --config config.ini
# re-download everything in range, ignoring saved state
python3 onelap_fit_export.py --config config.ini --all
# override the output folder on the fly
python3 onelap_fit_export.py --config config.ini --out /path/to/watch
# safe for cron (prevents overlapping runs)
python3 onelap_fit_export.py --config config.ini --lock /tmp/onelap.lockRun it hourly from cron:
0 * * * * /usr/bin/python3 /opt/onelap-fit-export/onelap_fit_export.py \
--config /opt/onelap-fit-export/config.ini \
--lock /tmp/onelap-fit-export.lock >> /var/log/onelap.log 2>&1The first run is a baseline: it records what exists without firing the post-hook, so you don't get spammed for your whole history. After that, only genuinely new rides are downloaded (and the hook runs).
See config.example.ini. Fields:
| Key | Meaning |
|---|---|
account / password |
Your onelap.com login (the international app). |
output_dir |
Where .FIT files are written. |
state_file |
Tracks already-downloaded rides for incremental sync. Leave empty to always fetch. |
start_date |
YYYY-MM-DD (UTC) or a unix timestamp — ignore rides before this. Empty = all. |
post_hook |
Shell command run after new files arrive. $ONELAP_NEW_COUNT = number of new files. |
config.ini holds your password, so it is git-ignored by default. Keep it chmod 600.
Set output_dir to SFS's watched folder and SFS imports automatically in
file-import mode:
output_dir = /opt/stacks/statistics-for-strava/watchHeads-up (upstream SFS bug): SFS's route/country tagging shells out to
geosopand passes the ride's geometry as a single command-line argument. Long rides (~>6000 track points) produce a WKT string larger than Linux's 128 KB per-argument limit (MAX_ARG_STRLEN), sogeosopfails to launch and the import errors out. The fix belongs upstream (downsample the route before theintersectscall, or pass geometry via stdin/a file). This exporter does not trigger the bug itself — it only writes.FITfiles — but if your SFS imports fail on long rides, that's the cause.
Documented so the tool is auditable and maintainable, not to encourage abuse.
- Two backends. The account lives on
www.onelap.com, but ride data lives onapi-fitness.rfsvr.com— a token minted bywww.onelap.com/api/loginis rejected by rfsvr, so we log in against rfsvr directly. - Login.
POST /api/v1/app/loginwith JSON{account, password: md5hex(pw)}→data.token(bearer) +data.userinfo.uid. - Request signing (every call). URL-based.
nonce= base64(6 random bytes),timestamp= unix seconds.signStr = "{path}?" + join(sorted "k=v&" over {nonce, timestamp, non-empty query params}) + "key={APIKEY}",sign = md5hex(signStr). The body is not signed.APIKEYis the app'sBuildConfig.ApiKey. - Required headers.
authorization,userid,platform(43iOS /44Android),app-name=onelapfit,app-version,nonce,timestamp,sign,onelap-region=1.deviceid/sessionidare not validated server-side. - List rides.
GET /api/v1/app/record/riding/list?data_type=all&source=all&start_time=&end_time=&p=. Responsedata.days.{ts}.info[]carriesfileKey,fileAddr(a presigned OSS URL, no auth, time-limited), plus distance/etc. Paginate viapage_count. - Download.
GET fileAddrdirectly — no auth headers needed. File name looks likeGEOID_CC600_{start}_{uid}_{end}.fit; bytes 8–12 are.FIT.
The signing key was recovered from the app's BuildConfig; endpoint/header
shapes were confirmed by inspecting the app's own HTTPS traffic.
This is an interoperability / personal-data-portability tool. It accesses your own account and your own ride data using your own credentials. It is not affiliated with, endorsed by, or supported by OnelapFit / Magene / Geoid. The API is undocumented and may change or break at any time. Respect OnelapFit's Terms of Service. Use at your own risk.