Zum Inhalt springen
GET /v1/convert

Convert a unit price between bases

Live testen

10 freie Calls pro Tag — keine Anmeldung, kein API-Key. Geht durchs oanor-Gateway.

Eigene Header (optional)
api.oanor.com/unitprice-api

Funktioniert. Hol dir einen API-Key und nutze sie in deinem Projekt.

API-Key holen

Code-Snippets

curl "https://api.oanor.com/unitprice-api/v1/convert" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/unitprice-api/v1/convert", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/unitprice-api/v1/convert");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/unitprice-api/v1/convert",
    headers={"x-oanor-key": "oanor_test_..."}
)

Beispiel-Response

Echte Antwort dieses Endpoints, erfasst beim letzten Health-Check.

{
    "data": {
        "note": "Converts a price expressed per one unit into the standard per-unit bases for that measure.",
        "input": {
            "from": "lb",
            "price": 5,
            "measure": "weight"
        },
        "unit_price": {
            "per_g": 0.011023,
            "per_kg": 11.0231,
            "per_lb": 5,
            "per_100g": 1.1023
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:20.206Z",
        "request_id": "a7d48585-f00b-4471-abeb-5fcc4d7e274f"
    },
    "status": "ok",
    "message": "Convert unit price",
    "success": true
}