This website is available for multi language.

obniz API

Let use a hardware as API

All things via API

obniz is fully controllable by sending json via WebSocket API.
Turning IO on/off, sending/receiging data via UART/SPI, using BLE/OLED etc,,,

This is a new way to control things from the internet.

Especially, WebSocket api let you to use obniz from your HTML and bi-directionaly communication.
obniz.js warps this API.

This page shows API details and specifications.


Each obniz has different API Endpoint.

WebSocket API


Example JavaScript usage

<!-- HTML Example -->
  // Simplest example
  var host = 'wss://'

  function connect() {
    var socket = new WebSocket(host + '/obniz/OBNIZ_ID_HERE/ws/1');

    socket.onmessage = function (event) {
      var arr = JSON.parse(;
      for (var i=0; i<arr.length; i++) {
        var obj = arr[i];
        if ( && {
          host =;
          socket.onmessage = null;
        if ( && {
          socket.send(JSON.stringify([{display:{clear:true}}, {display:{text:"Works fine."}}]));





Not only WebSocket API. Post json via HTTP REST API.
But you can't get any values from obniz via this API. Just sending.


reqeust content type must be application/json and body must contain json object.

Curl example.

curl -H "Content-Type: application/json" -X POST -d '[{"display":{"clear":true, "text":"Works fine."}}]'


After obniz has been owned by someone's account, obniz API can be used with API keys. This is optinoal But recommended.
See more details on each obniz setting page. It will appear on your account page after registration.

JSON Formats

All communication on WebSocket is JSON.
Control obniz by sending JSON and get values by receiving JSON from obniz.

See obniz WebSocket format