Temperature converter API
Convert temperatures between Celsius, Fahrenheit, kelvin and Rankine.
POST https://api.curatedapi.com/v1/calc/units/temperature
- Version 1
- MCP tool
calc_units_temperature - Try it in the browser
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).
| Input | Type | Description |
|---|---|---|
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.
| Result | Type | Description |
|---|---|---|
result | decimal (string) | The converted temperature. |
all_units | list of object | The value on every scale. |
Examples
Boiling water in Fahrenheit
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"
}'
{
"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
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"
}'
{
"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
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"
}'
{
"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
- BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius
- NIST Special Publication 811 (2008), section B.9: temperature conversion
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.