> Documentation index: https://nao-rs.lukaloehr.com/llms.txt, a list of every page in this documentation.

# Cameras

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

## List the cameras

`GET /v1/cameras`

**Token:** required · **Lease:** not needed

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | The cameras | array of [CameraInfo](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#camerainfo) |
| 401 | Missing or wrong token | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |

```bash
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

| Parameter | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `camera` | path | [CameraName](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#cameraname) | yes | top or bottom |

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | A fresh JPEG; `X-Image-Time` is the robot time it was taken | `image/jpeg` |
| 401 | Missing or wrong token | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 404 | Unknown camera | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 503 | No image within 3 s (vision not running?) | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |

```bash
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

| Parameter | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `camera` | path | [CameraName](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#cameraname) | yes | top or bottom |
| `fps` | query | number | no | Frames per second, 0.5 to 15 (default 5). (0.5 to 15) |

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | Motion JPEG (`multipart/x-mixed-replace; boundary=frame`) | `multipart/x-mixed-replace` |
| 401 | Missing or wrong token | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 404 | Unknown camera | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 422 | Invalid fps | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |
| 503 | Too many streams open | [ErrorBody](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md#errorbody) |

## Related topics

- [REST API](https://nao-rs.lukaloehr.com/reference/rest-api.md)
- [System](https://nao-rs.lukaloehr.com/reference/rest-api/system.md)
- [Robot](https://nao-rs.lukaloehr.com/reference/rest-api/robot.md)
- [State](https://nao-rs.lukaloehr.com/reference/rest-api/state.md)
- [Events](https://nao-rs.lukaloehr.com/reference/rest-api/events.md)
- [Safety](https://nao-rs.lukaloehr.com/reference/rest-api/safety.md)
- [Control](https://nao-rs.lukaloehr.com/reference/rest-api/control.md)
- [LEDs](https://nao-rs.lukaloehr.com/reference/rest-api/leds.md)
- [Audio](https://nao-rs.lukaloehr.com/reference/rest-api/audio.md)
- [Power](https://nao-rs.lukaloehr.com/reference/rest-api/power.md)
- [Motion](https://nao-rs.lukaloehr.com/reference/rest-api/motion.md)
- [Schemas](https://nao-rs.lukaloehr.com/reference/rest-api/schemas.md)
- Previous: [Audio](https://nao-rs.lukaloehr.com/reference/rest-api/audio.md)
- Next: [Power](https://nao-rs.lukaloehr.com/reference/rest-api/power.md)
