Unit Converter

Unit Converter API

Utilities

Convert measurements instantly with natural language. Convert length, weight, temperature, volume, area, speed, time, and pressure without complex formulas.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

10 requests per minute

Endpoints

2 endpoints available

Overview

Convert units described in plain English: length, weight, temperature, volume, area, speed, time, pressure and more. The conversion comes from an AI model and is returned as text: result holds the converted value and details holds the units and conversion factor used.

Limits

  • This endpoint calls an AI model, so it is on the AI tier: 10 requests per minute and 200 per day per API key.
  • question can be up to 2,000 characters.
  • The model's reply is split into result and details at a heading such as "Conversion Details" or "Explanation", or after the first line. Both are plain text and may contain Markdown.
  • If the conversion is not possible, result says why.
  • AI output can be wrong. Check results that matter.

Usage info

A GET request (with your API key) returns a short usage description and example questions. It does not call the model and counts against the standard limit, not the AI limit.

Endpoints

POST
https://opentools.ca/api/v1/tools/unit-converter
Convert units described in plain English

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
question
string
Required
The question in plain English (1 to 2,000 characters).

Response Example

{
  "success": true,
  "result": "5 kilometers is approximately **3.107 miles**.",
  "details": "- From: kilometers (km)\n- To: miles (mi)\n- Conversion factor: 1 km = 0.621371 mi\n- Calculation: 5 x 0.621371 = 3.107 mi"
}

Error Codes

400
Invalid request. Validation problems are listed in details.
401
Missing or invalid API key
403
API key is deactivated or expired, or this IP address is not allowed for the key
429
Rate limit exceeded (10 requests per minute per key, 200 per day)
500
Internal server error
GET
https://opentools.ca/api/v1/tools/unit-converter
Usage description and example questions. No model call.

Response Example

{
  "success": true,
  "description": "Convert units expressed in natural language",
  "usage": {
    "method": "POST",
    "body": {
      "question": "string (required) - The unit conversion in plain English"
    }
  },
  "examples": [
    "Convert 5 kilometers to miles",
    "What is 100 Celsius in Fahrenheit?",
    "How many pounds in 75 kilograms?",
    "Convert 2 hours to minutes",
    "What is 5 feet and 6 inches in centimeters?",
    "How many liters are in 3 gallons?"
  ]
}

Error Codes

401
Missing or invalid API key
403
API key is deactivated or expired, or this IP address is not allowed for the key
429
Rate limit exceeded (120 requests per minute per key)

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/unit-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "Convert 5 kilometers to miles"}'

Ready to get started?

Create an API key to start using the Unit Converter API.

Rather use it in your browser? Open the Unit Converter