Skip to content
moxon home

Temperature Conversion

The /convert endpoint allows you to convert multiple temperature units between each other. You need to provide a value to convert, a source unit, and the unit you want to convert to.

gethttps://api.moxon.dev/v3/convert

Parameters

  • valuestringrequired

    The value to convert

  • fromstringrequired

    The source unit (celsius, fahrenheit, kelvin)

  • tostringrequired

    The target unit (celsius, fahrenheit, kelvin)

Available Units

UnitDescription
celsiusCelsius degrees
fahrenheitFahrenheit degrees
kelvinKelvin

Request Example

Request
GET /v3/convert?value=30&from=celsius&to=kelvin

Response

Response
{
    "from": "celsius",
    "to": "kelvin",
    "value": 30,
    "result": 303.15
}

cURL

cURL
curl -X GET "https://api.moxon.dev/v3/convert?value=30&from=celsius&to=kelvin"

Error Handling

If parameters are missing or invalid, the API will return an error:

  • 400Please provide a valid value (?value={value})The value parameter is missing or invalid
  • 400Please provide a valid source unit (&from={unit})The from parameter is missing or invalid
  • 400Please provide a valid target unit (&to={unit})The to parameter is missing or invalid