Developer API and AI agent tools

Unit Conversion API & AI Agent Integration

Build with the same verified unit and measurement conversion engine that powers Conversion Encyclopedia. Developers and agents can use structured JSON responses, OpenAPI 3.1 discovery, API Catalog and browser-native WebMCP.

Unit conversion infrastructure

Shared conversion engine

The website, unit conversion API and agent tool resolve measurements through the same registered adapters and canonical identifiers.

Machine-readable JSON

Software and agents can submit a canonical request and receive structured results, basis metadata and a matching page path.

OpenAPI 3.1 discovery

The live specification describes the request model, response model, examples and supported error codes.

API Catalog RFC 9727

A well-known catalog gives automated clients a stable starting point for discovering the OpenAPI document.

Browser-native WebMCP

Compatible browser agents can discover and execute convert_measurement without duplicating conversion logic.

Context-aware conversions

Registered families can validate materials, solutes, battery parameters, media profiles and apparel profiles when context is required.

Machine interfaces and discovery

InterfacePurpose
POST /api/v1/convertExecute a unit or measurement conversion and return a JSON result.
GET /openapi.jsonRead the live OpenAPI 3.1 contract.
GET /.well-known/api-catalogDiscover the API through its RFC 9727 catalog.
WebMCP: convert_measurementInvoke the same engine from a compatible browser agent.

AI-first architecture and agent integration

Each interface is a different entry point to the same generalized conversion engine, canonical identifiers and validation rules.

People

  1. Human-readable HTML page
  2. Shared conversion engine

Browser agents

  1. WebMCP capability detection
  2. convert_measurement
  3. Shared conversion engine

WebMCP availability depends on browser and agent support; it is not implied for every chatbot or browser.

Interactive demonstration

Try the Unit Conversion API

Choose a documented example and send a live request to the generalized measurement conversion engine. No account or API key is currently required for this experimental public preview.

Request

{
  "family": "cooking",
  "value": 37,
  "from": "gram",
  "to": "tablespoon_us",
  "material": "molasses"
}

Live response

No request sent yet.

Run the example to inspect the live JSON response.

Equivalent cURL

curl https://conversionencyclopedia.com/api/v1/convert \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{"family":"cooking","value":37,"from":"gram","to":"tablespoon_us","material":"molasses"}'

The preview sends only the displayed request to the same-origin /api/v1/convert endpoint and adds no client-side tracking service. Access may be limited to protect availability.

Quick start

Send one of these canonical request bodies to POST /api/v1/convert. The essential results below are generated from the same requests covered by the API contract tests.

Cooking with material context

Convert 37 grams of molasses to US tablespoons using the canonical ingredient density.

Request

{
  "family": "cooking",
  "value": 37,
  "from": "gram",
  "to": "tablespoon_us",
  "material": "molasses"
}

Essential result

{
  "raw": 1.7514792899408285,
  "display": "1.75147928994",
  "canonicalPath": "/cooking/grams-to-tablespoons/molasses/"
}

Linear measurement conversion

Convert 37 feet to meters through an exact linear factor.

Request

{
  "family": "length",
  "value": 37,
  "from": "foot",
  "to": "meter"
}

Essential result

{
  "raw": 11.277600000000001,
  "display": "11.277600000000001",
  "canonicalPath": "/length/feet-to-meters/"
}

Affine temperature conversion

Convert 37 degrees Celsius to Fahrenheit with the registered affine formula.

Request

{
  "family": "temperature",
  "value": 37,
  "from": "celsius",
  "to": "fahrenheit"
}

Essential result

{
  "raw": 98.60000000000001,
  "display": "98.6",
  "canonicalPath": "/temperature/celsius-to-fahrenheit/"
}

Material-density conversion

Convert 37 grams of water to liters using the canonical material record.

Request

{
  "family": "material-density",
  "value": 37,
  "from": "gram",
  "to": "liter",
  "material": "water"
}

Essential result

{
  "raw": 0.037111334002006016,
  "display": "0.037111334002",
  "canonicalPath": "/material-density/grams-to-liters/water/"
}

Request and result model

Request

Every request supplies canonical family, value, from and to fields. A family may additionally accept material, solute or whitelisted parameters.

Identifiers use exact canonical values. The public layer does not fuzzy-match unknown units, materials, solutes or profiles.

Result

raw is the adapter's canonical mathematical result without artificial rounding from the public layer. normalized is present only where an adapter defines it, while display is presentation text.

basis explains the factor, formula or contextual record used. canonicalPath links the result to its human-readable conversion page.

Validation and errors

The API rejects unsupported families, unknown units, materials or profiles, missing parameters, out-of-domain values and malformed requests. It does not silently substitute a nearby identifier. See the OpenAPI specification for the complete status and error-code contract.

API access and crawler access are different

The interfaces above describe tool execution. Automated crawling is governed separately by the AI Access Policy, including identification and acceptable-access requirements.