{"openapi":"3.1.0","info":{"title":"Range Remap API","version":"1.0.0","description":"Map numbers between ranges. The scale endpoint linearly maps a value from an input range [in_min, in_max] onto an output range [out_min, out_max] — the classic map() you reach for with sensor readings, sliders and knobs, gauges and progress bars, and data-visualisation axes. It also returns the 0–1 position t, so with the default 0–1 output range it normalizes a value, and with a 0–1 input range it interpolates (lerp); output ranges may be reversed (out_min greater than out_max) to invert direction, and an optional clamp keeps the result inside the output range instead of extrapolating. The clamp endpoint constrains a value to a minimum and maximum and can additionally snap it to the nearest step. Everything is exact local maths, instant and deterministic. Ideal for IoT and embedded (Arduino-style map), audio and DSP, graphics and game development, dashboards and charts, and UI controls. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This maps scalar values — for interpolating vectors use a vector API and for animation easing curves use an easing API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/remap-api","description":"oanor gateway"}],"tags":[{"name":"Remap"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/clamp":{"get":{"operationId":"get_v1_clamp","tags":["Remap"],"summary":"Clamp and snap a value","description":"","parameters":[{"name":"value","in":"query","required":true,"description":"The value","schema":{"type":"string"},"example":"7.3"},{"name":"min","in":"query","required":true,"description":"Minimum","schema":{"type":"string"},"example":"0"},{"name":"max","in":"query","required":true,"description":"Maximum","schema":{"type":"string"},"example":"10"},{"name":"step","in":"query","required":false,"description":"Snap to the nearest multiple of step","schema":{"type":"string"},"example":"5"},{"name":"round","in":"query","required":false,"description":"Round to N decimals","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"max":10,"min":0,"value":7.3,"changed":true,"clamped":5,"snapped":true,"was_out_of_range":false},"meta":{"timestamp":"2026-06-03T17:42:20.281Z","request_id":"8afa764f-0d2e-4ca6-a3f7-c6aca24d00eb"},"status":"ok","message":"Clamp and snap a value","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/scale":{"get":{"operationId":"get_v1_scale","tags":["Remap"],"summary":"Map a value between ranges","description":"","parameters":[{"name":"value","in":"query","required":true,"description":"The input value","schema":{"type":"string"},"example":"512"},{"name":"in_min","in":"query","required":true,"description":"Input range start","schema":{"type":"string"},"example":"0"},{"name":"in_max","in":"query","required":true,"description":"Input range end","schema":{"type":"string"},"example":"1023"},{"name":"out_min","in":"query","required":false,"description":"Output range start (default 0)","schema":{"type":"string"},"example":"0"},{"name":"out_max","in":"query","required":false,"description":"Output range end (default 1)","schema":{"type":"string"},"example":"5"},{"name":"clamp","in":"query","required":false,"description":"Keep result within the output range (default false)","schema":{"type":"string"}},{"name":"round","in":"query","required":false,"description":"Round to N decimals","schema":{"type":"string"},"example":"3"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"t":0.5,"value":512,"in_max":1023,"in_min":0,"mapped":2.502,"clamped":false,"out_max":5,"out_min":0,"out_of_range":false},"meta":{"timestamp":"2026-06-03T17:42:20.365Z","request_id":"c46accbc-056e-49b0-9438-28d65b20672e"},"status":"ok","message":"Map a value between ranges","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Range Remap API","notes":"Mapped value = out_min + (value − in_min) ÷ (in_max − in_min) × (out_max − out_min). Output ranges may be reversed (out_min > out_max) to invert. Without clamp, values outside the input range extrapolate. This maps scalars — for vector interpolation use a vector API and for animation easing curves use an easing API. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/scale","params":{"clamp":"keep the result within the output range (default false)","round":"round to N decimals","value":"the input value (required)","in_max":"input range end (required)","in_min":"input range start (required)","out_max":"output range end (default 1)","out_min":"output range start (default 0)"},"returns":"the mapped value and its 0–1 position t"},{"path":"/v1/clamp","params":{"max":"maximum (required)","min":"minimum (required)","step":"optional — snap to the nearest multiple of step","round":"round to N decimals","value":"the value (required)"},"returns":"the clamped (and optionally snapped) value"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Map numbers between ranges. The scale endpoint linearly maps a value from an input range [in_min, in_max] to an output range [out_min, out_max] — the classic map() used for sensors, sliders, gauges, progress bars and data-visualisation axes. It also returns the 0–1 position t, so with the default 0–1 output it normalizes a value, and with a 0–1 input it interpolates (lerp). Turn on clamp to keep the result inside the output range. The clamp endpoint constrains a value to a min/max and can snap it to the nearest step. Pure local maths, no key."},"meta":{"timestamp":"2026-06-03T17:42:20.457Z","request_id":"5552f476-6e23-480c-b3ce-092630b73f1f"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4635,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":615,"monthly_call_quota":14150,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2605,"monthly_call_quota":192500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6405,"monthly_call_quota":1005000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/remap-api"}