curatedapi
Browse the docs

Guides

Finance

Excel functions

Late payments

E-invoices

Accounting

Number checks

VAT and GST

Billing and pricing

Money and currencies

Dates and time

Math

Unit conversion

Everyday

Health

Temperature converter API

Convert temperatures between Celsius, Fahrenheit, kelvin and Rankine.

POST https://api.curatedapi.com/v1/calc/units/temperature

Converts a temperature reading, or a temperature difference, between scales. A reading uses the scale offsets (0 °C = 32 °F); a difference does not (a rise of 10 °C is a rise of 18 °F). All factors are exact.

Formula

K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)
  • Readings below absolute zero are rejected. Differences may be negative.

Inputs

Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).

InputTypeDescription
value required decimal (string) The temperature (or temperature difference) to convert.
from_unit required C | K | F | R Scale of the value. Options: C: degree Celsius; K: kelvin; F: degree Fahrenheit; R: degree Rankine
to_unit C | K | F | R Scale to convert to. Omit to convert to every scale. Options: C: degree Celsius; K: kelvin; F: degree Fahrenheit; R: degree Rankine
quantity reading | difference
default reading
Whether the value is a reading or a difference between two readings. Options: reading: a temperature reading, like 20 °C; difference: a change or interval, like a rise of 5 °C
options.rounding half_even | half_up | half_down | up | down | ceiling | floor Rounding mode applied once to each result. Default half_even.
options.decimals integer Round results to this many digits after the decimal point.
options.significant_digits integer Round results to this many significant digits.

Result

Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.

ResultTypeDescription
resultdecimal (string)The converted temperature.
all_unitslist of objectThe value on every scale.

Examples

Boiling water in Fahrenheit

Requestcurl
curl https://api.curatedapi.com/v1/calc/units/temperature \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "100",
    "from_unit": "C",
    "to_unit": "F"
  }'
200 OKResponse
{
  "calculator": "units/temperature@1",
  "result": {
    "result": "212"
  },
  "exactness": {
    "result": "exact"
  },
  "precision": {
    "rounding": "half_even",
    "significant_digits": 15
  },
  "inputs": {
    "value": "100",
    "from_unit": "C",
    "to_unit": "F",
    "quantity": "reading"
  },
  "formula": "K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)",
  "references": [
    {
      "title": "BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius",
      "url": "https://www.bipm.org/en/publications/si-brochure"
    },
    {
      "title": "NIST Special Publication 811 (2008), section B.9: temperature conversion",
      "url": "https://www.nist.gov/pml/special-publication-811"
    }
  ],
  "warnings": []
}

Body temperature in Celsius

Requestcurl
curl https://api.curatedapi.com/v1/calc/units/temperature \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "98.6",
    "from_unit": "F",
    "to_unit": "C"
  }'
200 OKResponse
{
  "calculator": "units/temperature@1",
  "result": {
    "result": "37"
  },
  "exactness": {
    "result": "exact"
  },
  "precision": {
    "rounding": "half_even",
    "significant_digits": 15
  },
  "inputs": {
    "value": "98.6",
    "from_unit": "F",
    "to_unit": "C",
    "quantity": "reading"
  },
  "formula": "K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)",
  "references": [
    {
      "title": "BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius",
      "url": "https://www.bipm.org/en/publications/si-brochure"
    },
    {
      "title": "NIST Special Publication 811 (2008), section B.9: temperature conversion",
      "url": "https://www.nist.gov/pml/special-publication-811"
    }
  ],
  "warnings": []
}

A rise of 10 °C in °F

Requestcurl
curl https://api.curatedapi.com/v1/calc/units/temperature \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "10",
    "from_unit": "C",
    "to_unit": "F",
    "quantity": "difference"
  }'
200 OKResponse
{
  "calculator": "units/temperature@1",
  "result": {
    "result": "18"
  },
  "exactness": {
    "result": "exact"
  },
  "precision": {
    "rounding": "half_even",
    "significant_digits": 15
  },
  "inputs": {
    "value": "10",
    "from_unit": "C",
    "to_unit": "F",
    "quantity": "difference"
  },
  "formula": "K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)",
  "references": [
    {
      "title": "BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius",
      "url": "https://www.bipm.org/en/publications/si-brochure"
    },
    {
      "title": "NIST Special Publication 811 (2008), section B.9: temperature conversion",
      "url": "https://www.nist.gov/pml/special-publication-811"
    }
  ],
  "warnings": []
}

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.