Unit Converter

Authentication

Our API requires authentication for all endpoints. You must include your API token in the request headers using the Authorization header.

How to authenticate?

Include your API token in the request header as follows:

Example: Using cURL

curl -H "Authorization: Bearer YOUR_API_TOKEN" -s https://api.plenix.net/v1/unit-converter/convert

Example: Using JavaScript (fetch API)

                                                
fetch("https://api.plenix.net/v1/unit-converter/convert", {
    headers: {
        "Authorization": "Bearer YOUR_API_TOKEN"
    }
})
.then(response => response.json())
.then(data => console.log(data));
                                                
                                            

Example: Using Postman

1. Open Postman and create a new request.
2. Set the request type to GET.
3. Enter the URL:

https://api.plenix.net/v1/unit-converter/convert

4. Go to the Headers tab and add:
Key: Authorization
Value: Bearer YOUR_API_TOKEN
5. Click Send to receive the response.

Usage

This API provides various endpoints for unit conversion. You can convert between different units such as length, weight, temperature, and more. Below are the details of the available endpoints.

Unit Conversion

Convert a specific amount from one unit to another.

Parameters:

  • - value: (Required) The value to convert from the base unit.
  • - unit: (Required) The unit type.
  • - from: (Required) The base unit (e.g., meters, kilograms, Celsius, etc.).
  • - to: (Required) The target unit (e.g., kilometers, pounds, Fahrenheit, etc.).

Available Units:

Below is a list of the available unit types for conversion:

  • - Length: meters, kilometers, miles, feet
  • - Weight: kilograms, pounds, grams
  • - Temperature: Celsius, Fahrenheit, Kelvin
  • - Time: seconds, minutes, hours, days
  • - Speed: m/s, km/h, mph, knots
curl -H "Authorization: Bearer YOUR_API_TOKEN" -s https://api.plenix.net/v1/unit-converter/convert?value=100&unit=length&from=meters&to=kilometers
                                                
{
    "value": 100,
    "unit_type": "length",
    "from_unit": "meters",
    "to_unit": "kilometers",
    "result": 0.1
}