apyhub
DEVELOPER TOOLS · STANDARD DATA

Convert Units API

What it does

Unit Converter converts a numeric value from one measurement unit to another. Send value, from_unit, and to_unit, and get the converted number back in a structured response.

Use it when your application accepts measurements in one unit but needs to store, display, or compare them in another. It fits common workflow needs like converting lengths, weights, volumes, temperatures, or similar compatible units before calculation or presentation.

The response includes the original from and to units, the input value, and the converted result. That makes it easy to log both sides of the conversion or pass the output into downstream pricing, shipping, engineering, or form-validation logic.

Unit Converter is a small utility endpoint for any system that handles user-entered measurements and needs consistent units without adding conversion logic to your codebase.

GET
Convert a numeric value between compatible measurement units
http://localhost:8080/dosvak/unit-convert
QUICKSTARTGUIDE

Quickstart

Convert a value from one unit to another by sending the required query parameters.

curl -X GET "http://localhost:8080/dosvak/unit-convert?value=100&from_unit=cm&to_unit=m" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with to, from, value, and result fields. to and from are the unit names, value is the original number, and result is the converted number.

{
  "to": "m",
  "from": "cm",
  "value": 100,
  "result": 1
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Converts a numeric value from one measurement unit to another compatible unit. It takes the input value, source unit, and target unit as query parameters, and returns a JSON object describing the conversion input and computed result.

Query Parameter(s)

AttributeTypeMandatoryDescription
valueNumberYesNumeric value to convert.
from_unitStringYesSource measurement unit.
to_unitStringYesTarget measurement unit.

Response

Returns a JSON object with to, from, value, and result fields. to and from are strings, value is the input number, and result is the converted number.

AttributeTypeMandatoryDescription
toStringNoTarget unit.
fromStringNoSource unit.
valueNumberNoInput numeric value.
resultNumberNoConverted numeric result.

Query parameters

Name
Type
Description
valueREQUIRED
number
to_unitREQUIRED
string
from_unitREQUIRED
string
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.