/v1/angle
Servo angle from a pulse width
Probeer het live
10 gratis calls per dag — geen registratie, geen API-key. Loopt via de oanor-gateway.
Het werkt. Haal een API-key op en gebruik hem in je project.
Verkrijg een API-sleutelCodefragmenten
curl "https://api.oanor.com/servo-api/v1/angle" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/servo-api/v1/angle", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/servo-api/v1/angle");
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/servo-api/v1/angle",
headers={"x-oanor-key": "oanor_test_..."}
)
Voorbeeldrespons
Een echte respons van dit endpoint, vastgelegd bij de laatste health check.
{
"data": {
"note": "A hobby RC servo reads the width of the pulse, not a PWM duty cycle: the standard 1000–2000 µs maps linearly across the travel, with 1500 µs at centre. angle = (pulse − min) ÷ (min-to-max span) × the travel. Many servos accept a wider 500–2500 µs for extra throw, but pushing past the mechanical stops strains the gears — the unclamped value here shows when a pulse asks for more than the configured range.",
"inputs": {
"max_us": 2000,
"min_us": 1000,
"pulse_us": 1500,
"range_deg": 180
},
"angle_deg": 90,
"out_of_range": false,
"angle_unclamped_deg": 90
},
"meta": {
"timestamp": "2026-06-06T23:53:51.218Z",
"request_id": "2cd4666b-66c4-47f0-bafd-ad4e6ac3282e"
},
"status": "ok",
"message": "Servo angle",
"success": true
}