API Documentation

MotionConvert provides a RESTful API for programmatic access to unit conversion and drivetrain calculations.

Authentication

All API requests require authentication via a Bearer token. Generate an API key from your Account → API Keys page.

Authorization: Bearer mc_your_api_key_here

Include this header in every request. Requests without a valid token return 401 Unauthorized.

Rate Limits

Rate limits depend on your account tier:

TierRequests/Hour
Free60
Paid300
Pro1,000

Endpoints

GET /api/v1/units/

List all available unit categories and their units.

Response:
{ "categories": [ { "key": "rotational_speed", "name": "Rotational Speed", "units": [ {"key": "rpm", "name": "RPM", "symbol": "rpm"}, {"key": "rad_s", "name": "Radians/second", "symbol": "rad/s"}, {"key": "deg_s", "name": "Degrees/second", "symbol": "°/s"} ] } ] }

POST /api/v1/convert/

Convert a value from one unit to another.

Request:
{ "value": "100", "from_unit": "rpm", "to_unit": "rad_s" }
Response:
{ "result": "10.472", "from_unit": "rpm", "to_unit": "rad_s", "value": "100" }

POST /api/v1/drivetrain/calculate/

Calculate drivetrain output (speed, torque, ratio) from motor and gear stage configuration.

Request:
{ "motor": { "rpm": "1500", "torque": "10" }, "stages": [ {"input_mode": "ratio", "ratio": "5"}, {"input_mode": "ratio", "ratio": "3"} ], "output": { "mode": "rotation" } }
Response:
{ "output_rpm": "100", "output_torque": "150", "total_ratio": "15", "stages": [ {"ratio": "5", "output_rpm": "300", "output_torque": "50"}, {"ratio": "3", "output_rpm": "100", "output_torque": "150"} ] }

Error Responses

Errors return a JSON object with an error field:

{ "error": "Invalid unit: xyz" }
StatusMeaning
400Bad request (invalid JSON, missing fields)
401Authentication required
403Tier limit exceeded
429Rate limit exceeded
500Server error