Everything about obniz

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 obj = JSON.parse(;

      if ( && {
        host =;
        socket.onmessage = null;
      if ( && {
        socket.send(JSON.stringify({display:{clear:true, 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