/v1/pulse
Pulse width for a target angle
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
curl "https://api.oanor.com/servo-api/v1/pulse" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/servo-api/v1/pulse", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/servo-api/v1/pulse");
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/pulse",
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": "The pulse width for an angle inverts the servo map: pulse = min + (angle ÷ travel) × the min-to-max span, so on a 1000–2000 µs / 180° servo, 90° is 1500 µs and 45° is 1250 µs. This is the number a microcontroller writes to the servo each frame (about every 20 ms); libraries like Arduino's Servo take the angle and do exactly this conversion under the hood.",
"inputs": {
"max_us": 2000,
"min_us": 1000,
"angle_deg": 90,
"range_deg": 180
},
"pulse_us": 1500
},
"meta": {
"timestamp": "2026-06-06T23:53:51.426Z",
"request_id": "5d1b7465-abbe-47c5-9dfb-058d473df9c1"
},
"status": "ok",
"message": "Servo pulse",
"success": true
}