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/v2/convert

Parameters

  • valuestringrequired

    The value to convert

  • fromstringrequired

    The source unit (celsius, fahrenheit, or kelvin)

  • tostringrequired

    The unit to convert to (celsius, fahrenheit, or kelvin)

Available Units

  • celsius: Degrees Celsius
  • fahrenheit: Degrees Fahrenheit
  • kelvin: Kelvin

Request Example

Request
GET /v2/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/v2/convert?value=30&from=celsius&to=kelvin"

Error Handling

If the value, from, or to field is empty or invalid, an error will be returned.