I asked Claude 3.5 Sonnet embedded here in the forum about getting started with the THETA API, specifically requesting curl commands for Mac testing. The discussion covers essential aspects of the RICOH THETA API implementation and testing.
Don’t forget:
- Basic setup requires WiFi connection to the THETA camera (default IP: http://192.168.1.1)
Main curl commands covered:
- Basic camera information: GET http://192.168.1.1/osc/info
- Camera state: POST http://192.168.1.1/osc/state
- Take pictures: POST to /osc/commands/execute
- File operations (listing, deleting)
- Camera settings and options
- Live preview functionality
My question:
Can you write me a summary of all the curl commands i can use with the THETA API?
Theta_Persona_bot:
I’ll provide a comprehensive summary of the most useful curl commands for the THETA API. These are organized by function category.
Basic Information & Status Commands
# Get basic camera info
curl -X GET http://192.168.1.1/osc/info
# Get camera state
curl -X POST http://192.168.1.1/osc/state
# Check for firmware updates
curl -X POST http://192.168.1.1/osc/checkForUpdates
Image & Video Capture
# Take a picture
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.takePicture"}' \
http://192.168.1.1/osc/commands/execute
# Start video recording
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.startCapture"}' \
http://192.168.1.1/osc/commands/execute
# Stop video recording
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.stopCapture"}' \
http://192.168.1.1/osc/commands/execute
File Operations
# List files (most recent first)
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.listFiles",
"parameters": {
"fileType": "all",
"entryCount": 10,
"maxThumbSize": 0
}}' \
http://192.168.1.1/osc/commands/execute
# Delete a file
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.delete",
"parameters": {
"fileUri": "100RICOH/R0010015.JPG"
}}' \
http://192.168.1.1/osc/commands/execute
Camera Settings
# Get camera options
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.getOptions",
"parameters": {
"optionNames": ["iso", "shutterSpeed", "whiteBalance", "exposureProgram"]
}}' \
http://192.168.1.1/osc/commands/execute
# Set camera options
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.setOptions",
"parameters": {
"options": {
"iso": 100,
"shutterSpeed": 0.004
}
}}' \
http://192.168.1.1/osc/commands/execute
WiFi and Power Settings
# Turn off camera
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.closeSession"}' \
http://192.168.1.1/osc/commands/execute
# Set access point info (client mode)
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera._setAccessPoint",
"parameters": {
"ssid": "your-network-ssid",
"security": "WPA/WPA2 PSK",
"password": "your-password"
}}' \
http://192.168.1.1/osc/commands/execute
Live Preview
# Start live preview
curl -X POST \
--header "Content-Type: application/json" \
--data '{"name": "camera.getLivePreview"}' \
http://192.168.1.1/osc/commands/execute
Important Notes:
- Always use the
Content-Type: application/json
header for POST requests - The camera must be connected via WiFi
- The default IP address is 192.168.1.1
- Some commands may vary by camera model
- For commands that return a status ID, you can check the status with:
curl -X POST \
--header "Content-Type: application/json" \
--data '{"id": "command-id-returned"}' \
http://192.168.1.1/osc/commands/status
Additional Resources:
- Full API documentation: theta-api-specs/theta-web-api-v2.1 at main · ricohapi/theta-api-specs · GitHub
- API Testing Guide: RICOH THETA API Testing - Making Videos, Getting Options, Getting List of Files