# Interactions Statistics

> Source: https://docs.recombee.com/reql/functions/interactions-statistics

> For the complete documentation index, see [llms.txt](/llms.txt).

# Interactions Statistics

Note

These functions are not enabled by default due to higher resource consumption. Contact[support@recombee.com](mailto:support@recombee.com) if you need to enable them.

| Name                                                         | Description                                   | Example                                       |
| ------------------------------------------------------------ | --------------------------------------------- | --------------------------------------------- |
| [num\_item\_bookmarks](#reql-func-num-item-bookmarks)        | Returns the number of bookmarks of an item    | num\_item\_bookmarks('itemId') < 10           |
| [num\_item\_detail\_views](#reql-func-num-item-detail-views) | Returns the number of detail views of an item | num\_item\_detail\_views('itemId') < 10       |
| [num\_item\_purchases](#reql-func-num-item-purchases)        | Returns the number of purchases of an item    | num\_item\_purchases('itemId') < 10           |
| [num\_item\_ratings](#reql-func-num-item-ratings)            | Returns the number of ratings of an item      | num\_item\_ratings('itemId', "negative") < 10 |

## Number of Bookmarks

Returns number of bookmarks of an item specified by its ID.

### Definition

```
num_item_bookmarks(id)
```

| Argument | Type   | Meaning       |
| -------- | ------ | ------------- |
| id       | string | ID of an item |

### Example

```
// Only items with less than 5 bookmarks pass the filter
num_item_bookmarks('itemId') < 5
```

## Number of Detail Views

Returns number of detail views of an item specified by its ID.

### Definition

```
num_item_detail_views(id)
```

| Argument | Type   | Meaning       |
| -------- | ------ | ------------- |
| id       | string | ID of an item |

### Example

```
// Only items with less than 5 detail views pass the filter
num_item_detail_views('itemId') < 5
```

## Number of Purchases

Returns number of purchases of an item specified by its ID.

You can use this function for example for recommending only items that have just few purchases and you need to sell them.

### Definition

```
num_item_purchases(id)
```

| Argument | Type   | Meaning       |
| -------- | ------ | ------------- |
| id       | string | ID of an item |

### Example

```
// Only items with less than 5 purchases pass the filter
num_item_purchases('itemId') < 5
```

## Number of Ratings

Returns number of ratings of an item specified by its ID.

Optionally you can get number of only the `positive` ratings (> 0) or `negative` (< 0) ratings.

You can use this function for example for recommending only items that have already a certain number of positive ratings.

### Definition

```
num_item_ratings(id, rating_type)
```

| Argument     | Type   | Meaning                                                                |
| ------------ | ------ | ---------------------------------------------------------------------- |
| id           | string | ID of an item                                                          |
| rating\_type | string | _Optional._ Take into consideration only positive or negative ratings. |

### Example

```
// Only items with more than 5 positive ratings pass the filter
num_item_ratings('itemId', "positive") > 5
```