---
title: "getSimilarItems(fromItems:maxCount:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mlrecommender/getsimilaritems(fromitems:maxcount:)-kq37"
---

# getSimilarItems(fromItems:maxCount:)

Returns the top ranked similar items based on the model’s similarity type.

## Declaration

```swift
func getSimilarItems(fromItems: [any MLIdentifier], maxCount: Int = 10) throws -> MLDataTable
```

## Parameters

- `fromItems`: An array of item identifiers.
- `maxCount`: The maximum number of similar items per item in the fromItems column. The default is 10.
