> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/sensor-setup/api/imotions-api-setup-and-programming-guides.md).

# iMotions API Setup and Programming Guides

Enable the Event Receiving, Event Forwarding and Remote Control APIs in iMotions Lab, and download the API programming guides and code examples.

This Help Center article contains information about setting up iMotions API for interactions with external software.

Please refer to the attached iMotions API Programming Guide (PDF) for full documentation of iMotions API.

## 1) Enabling the iMotions APIs

For initial setup, iMotions APIs must be enabled in your [iMotions Global Settings](https://help.imotions.com/lab/getting-started/imotions-global-settings.md) - API tab.

1. Check ‘Enable…’ for any or all iMotions APIs that will be used.
2. Note Port numbers (for external programs that interact with iMotions APIs)
3. For Event Forwarding, ‘Serialize as JSON’ is generally recommended (for reading/verifying event contents)
4. Event Sources are required for using the Event Receiving API (to indicate the format of received sensor data).

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-fb7251bb933c71105868a484045e62f63d93a8a1%2Ff1b47c7bd5_image-D2V89TVG.webp?alt=media)

### Event Receiving API (Input to iMotions)

With the Event Receiving API, iMotions can receive and record data streams and event markers from other applications over the network. The incoming data/markers are synchronized with other data/recordings collected in iMotions.

1. Enable Event Receiving API in iMotions Global Settings - API tab.
2. Enable External Events API in Study Settings (to collect data with the API).

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-13508487d4f3a693d96122c405ebdf208fa1cf59%2Fe4126e4c65_image-65FDY8R2.webp?alt=media)

### Event Forwarding API (Output from iMotions)

With the Event Forwarding API, you can forward data and event markers to other applications over the network, in real-time, as it is being recorded in iMotions.

1. Enable Event Forwarding API in iMotions Global Settings - API tab.
2. Note the iMotions Event Forwarding Port (number) to be used with the external software that will receive iMotions data/events.
3. Event Forwarding has a JSON format option, which is recommended for use of forwarded events/information (with the 'name:value' pairs, provided by the JSON format).
4. Program external software to receive events from the iMotions Event Forwarding Port.

[Event Forwarding API Example (streaming to external software)](https://help.imotions.com/lab/sensor-setup/api/event-forwarding-api-example-streaming-to-external-software.md), i.e. *PuTTy software*.

### Remote Control (Commands to iMotions)

Use Remote Control to send commands to the iMotions platform, e.g. to start and stop recording, import and export data - as described in the iMotions API Programming Guide.

1. Enable Remote Control API in iMotions Global Settings - API tab.
2. Note the iMotions Remote Control Port (number) to be used with the external software that will interact with the API.
3. Program external software to send commands and (if applicable) receive responses.

## 2) API Guide PDF

iMotions 10.1.13 Programming Guide (May 2025)

{% file src="/files/3vDEuZLsOJMyIggDlcu4" %}

## 3) Examples using the iMotions API

For API examples using Psychopy, Python and TypeScript, refer to the iMotions Github: <https://github.com/imotions/iMotions-ApiExamples>

## Attachments

{% file src="/files/VmOFTdHOGIKXYB4yZQUc" %}
iMotions API Reference
{% endfile %}

{% file src="/files/eabtay4ttQo0QccQfZ3K" %}
iMotions API Setup Guide
{% endfile %}

{% file src="/files/cDb1h0ueBJpTpnPiCdE4" %}
Simple C# example of events and markers
{% endfile %}

{% file src="/files/2rOGPRPoGU6N4TkSgLTO" %}
Python example
{% endfile %}

{% file src="/files/wSK3G9MPOETGTsIsgdRN" %}
AFFDEX\_Class.py
{% endfile %}

{% file src="/files/wmXQKqub6ZqRZWe10Dr2" %}
Eye\_Tracking\_Class.py
{% endfile %}

{% file src="/files/Ys60GVd0qd3BiKsHOB62" %}
API\_Strooptest.m (MATLAB)
{% endfile %}

{% file src="/files/z6JeAFrqzzReAqaORkSN" %}
iMT\_RemoteControlAPI.m (MATLAB)
{% endfile %}

{% file src="/files/vVg3rqkuNmAoPfLKsHw0" %}
iMotions 9.x Programming Guide
{% endfile %}

{% file src="/files/vVg3rqkuNmAoPfLKsHw0" %}
iMotions 8.1 Programming Guide (October 2020)
{% endfile %}

{% file src="/files/1bKhyoZoDKdKr5jY6xGl" %}
iMotions 7.0 Programming Guide (January 2018)
{% endfile %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/sensor-setup/api/imotions-api-setup-and-programming-guides.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
