GET /v1/weightWeight / mass unit converter
Format Utils lf-format-utils
Converts a weight from one unit to another. Weight / mass unit converter
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Weight value |
from | string | No | Source unit (mg, g, kg, t, oz, lb, st, carat, ...) |
to | string | No | Target unit |
Response Schema
input (number): Input value
output (number): Converted value
from (string): Source unit
to (string): Target unit
cURL Example
curl 'https://lf-format-utils.laminarforge.dev/v1/weight?value=<value>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-format-utils.laminarforge.dev/v1/weight'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'value': '<value>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())