Cycling Data API for FIT Files, Power and Pacing
Analyze a FIT activity, calculate cycling power zones or build a pacing plan from a GPX course. Use REST from your scripts or connect an MCP client. You supply the inputs and can run the examples without an account or API key.
OpenAPI 3.1 specification lists the operations, field types, units and response schemas.
Make your first cycling REST API request
How fast is a 50×17 gear at 90 rpm? Send this request for a bike with a 622 mm rim and a 28 mm tire.
curl https://cyclingdatalab.com/api/v1/cadence-speed -H "Content-Type: application/json" -d '{"chainringTeeth":[50],"sprocketTeeth":[17],"cadencesRpm":[90],"rimDiameterMillimeters":622,"tireThicknessMillimeters":28}'
The JSON response gives a speed of about 33.8 km/h. The example below rounds the speed to four decimal places.
{"cadencesRpm":[90],"gears":[{"chainringTeeth":50,"sprocketTeeth":17,"speedsKmh":[33.8294]}]}
Use the same JSON request format for training zones, Critical Power, lactate thresholds and climb time. For activity and course files, follow the FIT and race simulation examples below.
Machine-readable resources
- GET / serves Markdown with
Accept: text/markdownand HTML withAccept: text/html. - GET /index.md serves the homepage as Markdown directly.
- GET /llms.txt describes when to use each tool and how to open it.
- GET /openapi.json describes the public calculation API.
- GET /sitemap.xml lists public page URLs.
- GET /robots.txt lists crawler directives.
Requests for missing pages can return a Markdown explanation with HTTP 404 when sent with Accept: text/markdown.
Model Context Protocol (MCP)
Add https://cyclingdatalab.com/mcp as a remote MCP server in your client. Select Streamable HTTP if the client asks for a transport. The server exposes the 11 public calculation and file operations without sign-in or an API key.
Discover tools with tools/list. Tool names match the OpenAPI operation IDs. Calculator tools take the same JSON fields inside a request argument. For example, send these tools/call parameters to calculate speed at 90 rpm.
{"name":"calculateCadenceSpeed","arguments":{"request":{"chainringTeeth":[50],"sprocketTeeth":[17],"cadencesRpm":[90],"rimDiameterMillimeters":622,"tireThicknessMillimeters":28}}}
File tools take fileName and fileBase64 with up to 10 MiB per decoded file. FIT summary and crop accept FIT files. Pacing simulation and export accept FIT or GPX courses. Crop and export return an embedded FIT resource and structured filename and media type.
REST and MCP calls share the calculation quotas below. MCP also limits protocol requests per client IP. Retry tool errors with code rate_limit_exceeded after the returned retryAfterSeconds. An HTTP 429 includes a Retry-After header.
FIT and race simulation
Use multipart/form-data with a file field. For example, run curl -F "[email protected]" -F "maxSamples=10" https://cyclingdatalab.com/api/v1/fit/summary to get statistics, lap boundaries, and up to ten samples. Crop by elapsed seconds or lap numbers with POST /api/v1/fit/crop. FIT samples can include recorded GPS coordinates.
For race pacing, post a FIT or GPX course to /api/v1/race-simulator. See the OpenAPI specification for the optional rider, bike, and pacing settings. The file names in multipart examples stand for local files to upload.
Download a FIT pacing course with curl -F "[email protected]" "https://cyclingdatalab.com/api/v1/race-simulator/export?format=pacingCourse" -o race-pacing.fit. Use format=garminWorkout for a Garmin workout.
Files may be up to 10 MiB and must contain at most 100,000 decoded entries. FIT summary and crop support up to 256 laps. Race simulation supports up to 128 segments and 512 course legs.
Errors and request limits
API errors include a machine-readable code, a detail message, and field errors where applicable. JSON request bodies may be up to 32 KiB.
Calculation API responses report the quota for your client IP on the serving app instance. File requests and best-effort estimates use the compute quota. Other calculators use standard. Admitted requests use one token each, and tokens refill one at a time.
RateLimit-Policy: "standard";q=10;w=10describes a burst capacity of ten requests (q) and a full refill time of ten seconds (w, rounded up).RateLimit: "standard";r=0;t=1reports the tokens currently available (r) and a suggested wait in seconds (t) when the bucket is empty.Retry-After: 1on429 Too Many Requeststells you to wait at least one second before retrying. The compute concurrency cap can also return a 429 while tokens are still available.
The IETF RateLimit draft defines the structured fields.
Bike Fitting analyzes photos and videos in the browser. For integration requests, use the contact form.