Aller au contenu
GET /v1/yardage

Fabric for cut pieces

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/sewing-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/sewing-api/v1/yardage" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/sewing-api/v1/yardage", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/sewing-api/v1/yardage");
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/sewing-api/v1/yardage",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "data": {
        "note": "Pieces per row = floor(fabric width ÷ piece width); rows = ceil(quantity ÷ per row); fabric length = rows × piece height, plus waste. Add pattern-repeat allowance for prints.",
        "inputs": {
            "quantity": 6,
            "piece_width": 18,
            "fabric_width": 44,
            "piece_height": 22,
            "waste_percent": 10
        },
        "rows_needed": 3,
        "length_yards": 2.0167,
        "length_inches": 72.6,
        "length_meters": 1.844,
        "pieces_per_row": 2
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:09.859Z",
        "request_id": "cb2b33c4-4afd-4290-bf69-b2a5f837167b"
    },
    "status": "ok",
    "message": "Fabric yardage",
    "success": true
}