Call the THETA Web API using the Linux curl command. If you use Windows curl.exe, you need to change the ' to " and " to \\".

When you execute a command, you will gain a better understanding by adding or modifying parameters or setting options by referring to the Web API reference as appropriate.

Advance preparation

  1. Turn on the THETA WLAN. If it is in client mode, switch to access point mode.
  2. THETA SSID begins with THETA followed by a serial number and .OSC (e.g. THETAYR15104645.OSC). Connect the PC WiFi to THETA. The THETA IP address is 192.168.1.1 and the Web API port is 80.

Get the THETA information

Request calling the info protocol:

$ curl [<http://192.168.1.1/osc/info>](<http://192.168.1.1/osc/info>)

Response:

{
    "api": [
        "/osc/info",
        "/osc/state",
        "/osc/checkForUpdates",
        "/osc/commands/execute",
        "/osc/commands/status"
    ],
    "apiLevel": [
        2
    ],
    "_bluetoothMacAddress": "58:38:79:78:A2:35",
    "endpoints": {
        "httpPort": 80,
        "httpUpdatesPort": 80
    },
    "firmwareVersion": "2.30.0",
    "gps": true,
    "gyro": true,
    "manufacturer": "Ricoh Company, Ltd.",
    "model": "RICOH THETA X",
    "serialNumber": "15104645",
    "supportUrl": "<https://theta360.com/en/support/>",
    "uptime": 568,
    "_wlanMacAddress": "3C:21:9C:F0:39:C1"
}

Take a photo and download it

Set THETA to still image shooting mode and issue the following request. Request to call camera.takePicture command:

$ curl -X POST [<http://192.168.1.1/osc/commands/execute>](<http://192.168.1.1/osc/commands/execute>) --data '{"name":"camera.takePicture"}' -H 'content-type: application/json'

Response to camera.takePicture command:

{
    "id": "44",
    "progress": {
        "completion": 0
    },
    "name": "camera.takePicture",
    "state": "inProgress"
}

Request to Commands/Status protocol:

$ curl -X POST [<http://192.168.1.1/osc/commands/status>](<http://192.168.1.1/osc/commands/status>) --data '{"id":44}' -H 'content-type: application/json'

Response to Commands/Status protocol:

{
    "results": {
        "fileUrl": "<http://192.168.1.1/files/100RICOH/R0010144.JPG>"
    },
    "name": "camera.takePicture",
    "state": "done"
}

Request to get an image file:

$ curl [<http://192.168.1.1/files/100RICOH/R0010144.JPG>](<http://192.168.1.1/files/100RICOH/R0010144.JPG>) > tmp.jpg

Request to obtain a thumbnail image file:

$ curl [<http://192.168.1.1/files/100RICOH/R0010144.JPG?type=thumb>](<http://192.168.1.1/files/100RICOH/R0010144.JPG?type=thumb>) > tmp-thumb.jpg