Skip to content
T
Tools.Town
Free Online Tools for Everyone

Weight Converter API

Convert mg / g / kg / metric ton / oz / lb / stone — all 7 units update live as you type.

Category: Converters Endpoint: /v1/converters/weight Method: GET Auth: API Key

Fast & Accurate

Get precise results instantly.

Easy Integration

Simple REST API with JSON response.

Developer Friendly

Clear docs and SDK examples.

Free to Start

5,000 free requests/month.

Endpoint

All requests should be made to the following endpoint:

GET https://api.tools.town/v1/converters/weight

Authentication

This endpoint requires an API Key. Include your API key in the request header.

Authorization: Bearer YOUR_API_KEY
You can get your API key from your dashboard.

Request Parameters

Send a GET request with query parameters.

Parameter Type Required Description Example
value number Numeric value to convert. 1
from string Source unit (mg, g, kg, t, oz, lb, st). kg
to string Target unit. g

Example Request

curl -G "https://api.tools.town/v1/converters/weight" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "value=1" \
  --data-urlencode "from=kg" \
  --data-urlencode "to=g"

Example Response 200 OK

application/json
{
  "success": true,
  "data": {
    "input": "0",
    "output": "0",
    "from": "string",
    "to": "string",
    "fromLabel": "string",
    "toLabel": "string"
  }
}

Error Codes

Code Meaning
400 Bad Request — missing or invalid parameter
401 Unauthorized — API key missing or invalid
429 Rate limit exceeded — free tier: 5,000 requests/month
500 Internal Server Error — try again or contact support