Skip to main content
KL
Kg to litre
Developer API Portal

Mass & Density REST API Documentation

Power your inventory software, recipe apps, fuel logistics platforms, construction tools, and AI agents with verified material conversion APIs.

Interactive REST API Explorer

Test endpoints in real-time, generate client integration code, and access 700+ verified substance density records

REST v1.1API Online
Target Integrations & Real-World Use Cases
📦Inventory ERP

Bulk liquid stock balance

🍳Recipe Apps

Mass to volume scaling

Fuel Logistics

Bunkering & fuel custody

🧪Chemistry Ed

Lab reagent solutions

🏗️Construction

Mix & aggregate sizing

🤖AI Agents

Scientific tool calling

GET/api/convert?mass=10&from=kg&to=liter&substance=diesel
Client Code Snippet
Response Inspector
200 OK12ms

HTTPStandard Endpoints Specification

Method & EndpointParameters / BodyDescription
GET /api/convert?mass=10&from=kg&to=liter&substance=dieselConverts mass to volume or volume to mass for any registered material.
GET /api/substances?page=1&limit=50&category=petroleum&search=dieselPaginated catalogue query with search, category filtering, and min/max density.
GET /api/substances/:id:id (e.g. water-pure, diesel-2)Fetches complete substance metadata, reference temperature, and sources.
POST /api/convert/batch{ "substances": ["diesel", "water"], "massKg": 10 }Bulk array conversion calculating volumes for multiple substances in one request.
GET /data/substances.jsonNone (Static JSON CDN)Direct raw JSON download of all 700+ compiled density records.
Developer FAQs

Frequently Asked Questions

Is an API key required to access the KgToLitre REST API or JSON catalogue?+
No API key is required. The static JSON catalogue (/data/substances.json) and query endpoints are open and CORS-enabled for web applications, mobile apps, and backend services.
How does the GET /api/convert endpoint work?+
You provide the mass, substance name or key, and units via query parameters (e.g. GET /api/convert?mass=10&from=kg&to=liter&substance=diesel). The API looks up the verified reference density and returns the exact converted volume, density, and applied formula.
Can I perform batch conversions in a single request?+
Yes. Use POST /api/convert/batch with a JSON payload of substance IDs (e.g. {"substances": ["diesel-2", "water-pure", "vegetable-oil"], "massKg": 10}) to convert multiple substances simultaneously.
Are results suitable for AI agents and LLM tool calling?+
Yes. The API returns standardized JSON with strict numerical types, making it ideal for function calling and deterministic unit conversions in AI agent pipelines.