HTTP API
BlinkEasy provides a simple way to integrate with your own applications. For example, to create custom analytics or to control IoT devices, such as adjusting lighting based on blink rate.
This advanced feature can be enabled by specifying a callback url in the settings page. (ESP32 code sample).
- To ensure privacy, the HTTP Module is limited to generalized data and cannot send video frames or personally identifiable information.
- Requests are sent instantly when events occur and periodically to report statistics, such as the current blink rate.
- Custom parameters are supported to include credentials or differentiate between devices.
Parameters send with every request:
event | ID of the event. Possible values: BLINK, START, END, BPM, ALERT, BREAK |
timestamp | Milliseconds elapsed since Jan 01 1970 (UTC). |
Example:
http://localhost:3000/myscript.php?event=START×tamp=1723321032811
Possible events:
BLINK
Send when a blink was detected.
Parameters:
duration | Blink duration in milliseconds |
bpm | Current Blinkrate (blinks per minute) |
Example:
http://localhost:3000/myscript.php?event=BLINK&bpm=13.2&duration=185×tamp=1723321032811
START
Send when a face was detected for the first time, starting the session.
Example:
http://localhost:3000/myscript.php?event=START×tamp=1723321032811
END
Send when for timeout milliseconds no faces were detected, ending the current session.
Parameters:
timeout | Current session timeout in milliseconds. The last time a face was recognized is the events timestamp minus the timeout. |
Example:
http://localhost:3000/myscript.php?event=END&timeout=60×tamp=1723321032811
BPM
Periodic event
Parameters:
bpm | Current blink rate in blinks per minute. |
Example:
http://localhost:3000/myscript.php?event=BPM&bpm=13.2×tamp=1723321032811
ALERT
Send when the user's blink rate has fallen under the given threshold. This event will also be send when blink reminders are disabled.
Parameters:
bpm | Current blink rate in blinks per minute. |
target | The threshold that the current blink rate has fallen below. |
duration | Number of milliseconds below the target until the alert was issued. |
Example:
http://localhost:3000/myscript.php?event=ALERT&bpm=13.2&target=15.0&duration=12×tamp=1723321032811
BREAK
A break reminder was issued.
Parameters:
none
Example:
http://localhost:3000/myscript.php?event=BREAK×tamp=1723321032811