Access to the THETA S API using JavaScript and node.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

THETA S API JavaScript Examples

Refer to the Unofficial API Guide from the THETA Developers community for more information.

JavaScript will not work from within the browser directly. You must use Node.js or equivalent.

The THETA S will accept a standard HTTP POST command. You can access the THETA directly with POST. You do not need these modules. To get you started faster, there are two different node modules with source code available that handle the connection and parameters:

  1. osc-client from turbobeast
  2. osc-client-theta_s from horihiro

Sample code using the node modules in this repository

  • osc-client-video-sample.js by Nate Levine
  • osc-client-theta_s-example.js by HoriHiro

Information below is from HoriHiro, the author of the code.

OSC(Open Spherical Camera) APIs client for RICOH THETA S


This module is OSC(Open Spherical Camera) APIs client for RICOH THETA S, and based on osc-client.


npm install osc-client-theta_s


All of the usage of this module is the same as that of the osc-client, except capturing and download movies. Following code is example of capturing and download movies.

var ThetaSOscClient = require('osc-client-theta_s').ThetaSOscClient;

var _thetaClient = new ThetaSOscClient();
var sessionId;

// 1. Get session-id
  sessionId = res.body.results.sessionId;
  // 2. Change captureMode to "_video"
  return _thetaClient.setOptions(_sessionId, {captureMode:"_video"})
  // 3. Start capturing
  return _thetaClient.startCapture(_sessionId);
}).catch(function (error) {

// 1. Stop capturing
  // 2. Get list of contents in a device
  return _thetaClient.listAll({entryCount:1, sort:"newest"});
  // 3. Download a movie
  return _thetaClient.getVideo(res.body.results.entries[0], "full");
  // 4. Store the movie
  fs.writeFile(filename, res.body);
  // 5. Close session
  return client.closeSession(sessionId);
}).catch(function (error) {