ReferenceREST API

Cameras

REST API: Images and Motion JPEG. Generated from the OpenAPI document.

List the cameras

GET /v1/cameras

Token: required · Lease: not needed

StatusMeaningBody
200The camerasarray of CameraInfo
401Missing or wrong tokenErrorBody
curl -H "Authorization: Bearer $TOKEN" http://$ROBOT:7702/v1/cameras

Take a picture

GET /v1/cameras/{camera}/image

Waits up to 3 s for a fresh JPEG. X-Image-Time is the robot time it was taken.

Token: required · Lease: not needed

ParameterInTypeRequiredMeaning
camerapathCameraNameyestop or bottom
StatusMeaningBody
200A fresh JPEG; X-Image-Time is the robot time it was takenimage/jpeg
401Missing or wrong tokenErrorBody
404Unknown cameraErrorBody
503No image within 3 s (vision not running?)ErrorBody
curl -H "Authorization: Bearer $TOKEN" http://$ROBOT:7702/v1/cameras/top/image > top.jpg

Stream a camera

GET /v1/cameras/{camera}/stream

Motion JPEG; works as the src of an <img> with ?access_token=.

Token: required · Lease: not needed

ParameterInTypeRequiredMeaning
camerapathCameraNameyestop or bottom
fpsquerynumbernoFrames per second, 0.5 to 15 (default 5). (0.5 to 15)
StatusMeaningBody
200Motion JPEG (multipart/x-mixed-replace; boundary=frame)multipart/x-mixed-replace
401Missing or wrong tokenErrorBody
404Unknown cameraErrorBody
422Invalid fpsErrorBody
503Too many streams openErrorBody

On this page