Convert between different units of measurement including length, weight, temperature, digital storage, and more. Simple, accurate, and reliable unit conversions.
GET https://convert.freeapi.me/convert?value=100&from=c&to=f
{
"originalValue": 100,
"fromUnit": "c",
"convertedValue": 212,
"toUnit": "f"
}
https://convert.freeapi.me/
All API requests should be made to this endpoint. HTTPS is required for all API calls.
Endpoint | Method | Description |
---|---|---|
/convert | GET | Convert a value from one unit to another |
/help | GET | Get detailed information about supported units and usage examples |
/ | GET | Root endpoint, same as /help |
The following query parameters can be used with the /convert endpoint:
Parameter | Type | Description |
---|---|---|
value | number | Required. The numerical value to convert. |
from | string | Required. The source unit to convert from (e.g., "km", "lb", "c"). |
to | string | Required. The target unit to convert to (e.g., "miles", "kg", "f"). |
roundoptional | integer | Number of decimal places to round the result to. Must be a non-negative integer. |
# Convert 10 kilometers to miles curl "https://convert.freeapi.me/convert?value=10&from=km&to=miles" # Convert 100 Celsius to Fahrenheit, rounded to 1 decimal place curl "https://convert.freeapi.me/convert?value=100&from=c&to=f&round=1" # Convert 1.5 GB to MB curl "https://convert.freeapi.me/convert?value=1.5&from=GB&to=MB"
// Convert 10 kilometers to miles fetch('https://convert.freeapi.me/convert?value=10&from=km&to=miles') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); // Convert with rounding fetch('https://convert.freeapi.me/convert?value=100&from=c&to=f&round=1') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
import requests # Convert 10 kilometers to miles response = requests.get('https://convert.freeapi.me/convert', params={'value': 10, 'from': 'km', 'to': 'miles'}) data = response.json() print(data) # Convert with rounding response = requests.get('https://convert.freeapi.me/convert', params={'value': 100, 'from': 'c', 'to': 'f', 'round': 1}) data = response.json() print(data)
// Convert 10 kilometers to miles $url = 'https://convert.freeapi.me/convert?value=10&from=km&to=miles'; $response = file_get_contents($url); $data = json_decode($response, true); print_r($data); // Convert with rounding $url = 'https://convert.freeapi.me/convert?value=100&from=c&to=f&round=1'; $response = file_get_contents($url); $data = json_decode($response, true); print_r($data);
The API returns a JSON object with details about the conversion:
{ "originalValue": 10, // The input value provided "fromUnit": "km", // The source unit (canonical form) "convertedValue": 6.21371, // The converted result "toUnit": "miles", // The target unit (canonical form) "roundingPlaces": 2 // Only included if rounding was applied }
The API may return the following error responses:
Error response format:
{ "error": "Detailed error message explaining what went wrong" }
The API supports conversion between units within the following categories. Units can only be converted within the same category.
Units for measuring distance or linear dimensions
Units for measuring mass
Units for measuring temperature
Units for measuring digital information storage (Base 1000)
Units for measuring data transfer rates (Base 1000)
Units for measuring time durations
Units for measuring liquid capacity
Units for measuring two-dimensional space
Unit Aliases
The API supports various aliases for the same unit. For example, you can use "km", "kilometer", or "kilometers" interchangeably.
For a complete list of supported units and their aliases, you can make a request to the /help
endpoint.
GET https://convert.freeapi.me/help