Metric/Imperial Converter API

github icon

An API Endpoint to convert Metric to Imperial units and vice versa.

kg ⇄ lbs km ⇄ mi l ⇄ gal

API URL

m-i-converter.herokuapp.com/api/convert

Example Request

~/api/convert?input=4gal
~/api/convert?input=3.5L
~/api/convert?input=1.5/5mi

Example Response

{
“initNum”: 1,
“initUnit”: “kg”,
“returnNum”: 2.20462,
“returnUnit”: “lbs”,
“string”: “1 kilograms converts to 2.20462 pounds”
}

Implementation

implementation

Front-End

Result