> For the complete documentation index, see [llms.txt](https://captic-2.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://captic-2.gitbook.io/docs/overview/hands-on/integrating-your-robot/rest.md).

# REST

Connect your own software to the Product API.

Every Captic device hosts the **Product API**, a local REST API that exposes everything you can do in the Product UI, and more. Use it when you want full flexibility or a tight integration with your own software.

You send HTTP requests and get JSON responses back.

|                   | Address                                      |
| ----------------- | -------------------------------------------- |
| API               | `http://[device-ip]:5004`                    |
| API documentation | `http://[serial-number].local:3000/api/docs` |

## API documentation

The full, interactive API documentation, with every endpoint, payload and response schema, is served by the device itself. It always matches the software version running on that device, and you can try requests directly from your browser.

Open it on a computer on the same network as the device:

```
http://[serial-number].local:3000/api/docs
```

## Example (Python)

This example starts a vision job, fetches its result and extracts the pose:

```python
import requests

HOST = "http://[device-ip]:5004"

def run_vision_job():
    # start a job on the depalletizer pipeline
    response = requests.post(f"{HOST}/api/v1/runs/", json={"pipeline_id": "depal"})
    run_id = response.json()["run_id"]

    # fetch the result
    result = requests.get(f"{HOST}/api/v1/runs/{run_id}").json()["result"]

    return {axis: result[axis] for axis in ("x", "y", "z", "a", "b", "c")}

run_vision_job()
```

The pipeline ID and result fields depend on your product. Check the API documentation on your device for the exact names.

{% hint style="warning" %}
The Product API gives full control over the system. Test changes in Human Mode before using them in production.
{% endhint %}

{% hint style="info" %}
Questions? Contact <support@captic.com>.
{% endhint %}
