> For the complete documentation index, see [llms.txt](https://docs.recognito.vision/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.recognito.vision/id-document-liveness-detection-sdk/integration-guide/linux/api-reference.md).

# API Reference

### get\_deviceid <a href="#get_device_id" id="get_device_id"></a>

```python
def get_deviceid() -> str:
```

<table data-header-hidden><thead><tr><th width="136"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>get_device_id</td></tr><tr><td><strong>Description</strong></td><td>Retrieves the Hardware ID.</td></tr><tr><td><strong>Input</strong></td><td>None</td></tr><tr><td><strong>Output</strong></td><td>The Hardware ID is returned as a standard Python string.</td></tr></tbody></table>

### set\_activation

{% code overflow="wrap" %}

```python
def set_activation(license_key: str) -> int:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>set_activation</td></tr><tr><td><strong>Description</strong></td><td>Activates the SDK using the provided license key.</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>license_key</strong> (str): License key string, this should be encoded as UTF-8.</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>Status code indicating the result of the activation.</p><ul><li>0: Success</li><li>Non-zero: Initialization failed</li></ul></td></tr></tbody></table>

### init\_sdk

{% code overflow="wrap" %}

```python
def init_sdk(model_path: str) -> int:
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>init_sdk</td></tr><tr><td><strong>Description</strong></td><td>Initializes the SDK with the required dictionary files.</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>model_path</strong> (str): Path to the engine binary files directory, This path must be provided as a UTF-8 encoded string.</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>Status code indicating the result of the initialization.</p><ul><li>0: Success</li><li>Non-zero: Initialization failed</li></ul></td></tr></tbody></table>

### processImage

{% code overflow="wrap" %}

```python
def processImage(image: ndarray, width: int, height: int) -> str
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>processImage</td></tr><tr><td><strong>Description</strong></td><td>Processes the ID document liveness check</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>image</strong> (ndarray): Numpy array for input image file.</li><li><strong>width</strong> (int): Width of image.</li><li><strong>height</strong> (int): Height of image.</li></ul></td></tr><tr><td><strong>Output</strong></td><td>A JSON-formatted result string</td></tr></tbody></table>

#### Example of Liveness Check Results

```json
{
    "screenReply":0.000424702302553,
    "printedCopy":0.000000003402590,
    "portraitReplace":0.037854608148336,
    "status":"Ok"
}
```

**Liveness Score Values (Default Threshold is 0.5)**

≥ 0.5: Genuine, < 0.5: Spoof
