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

Length Converter API

Convert between mm, cm, m, km, inches, feet, yards, miles — all 8 units update live as you type into any cell.

Category: Converters Endpoint: /v1/converters/length 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/length

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. 100
from string Source unit (mm, cm, m, km, in, ft, yd, mi). m
to string Target unit. cm

Example Request

curl -G "https://api.tools.town/v1/converters/length" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "value=100" \
  --data-urlencode "from=m" \
  --data-urlencode "to=cm"

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