# Get Collections

Use this method to get metadata of multiple collections at the same time.&#x20;

### Usage in your script

```csharp
GetCollections
  .Initialize(destroyAtEnd: true)
  .SetParameters(
    perPage: "20",
    page: "1",
    sortBy: "name",
    sortDir: "asc"
  )
  .filter( //optional
    address:"0x2A...2"
)
  .OnError(error => Debug.Log(error))
  .OnComplete(result => Debug.Log(result))
  .Run();
```

#### Member Functions

**`.Initialize()`**

<table><thead><tr><th width="193">Parameter</th><th width="80">Type</th><th width="105">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>destroyAtEnd</code></td><td><strong>bool</strong></td><td><strong>Optional</strong></td><td>defines if this component will be destroyed after <code>.Run()</code></td></tr></tbody></table>

**`.SetParameters()`**

<table><thead><tr><th width="193.33333333333331">Parameter</th><th width="88">Type</th><th width="109">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>perPage</code></td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>The number of collections to return</td></tr><tr><td><code>page</code></td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>The offset for returned collections. Calculated as (page - 1) * perPage</td></tr><tr><td><code>sortBy</code></td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>The field to sort the collections by (any field in the collection schema may be used)</td></tr><tr><td><code>sortDir</code></td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>Choose to sort in ascending (asc) or descending (desc) order</td></tr></tbody></table>

`.filter()`

<table><thead><tr><th>Parameter</th><th width="96">Type</th><th width="133.33333333333331">Required</th><th>Description</th></tr></thead><tbody><tr><td>isVerified</td><td><strong>Bool</strong></td><td><strong>Optional</strong></td><td>filter if collection is verfied by Altura</td></tr><tr><td>address</td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>filter by collection address</td></tr><tr><td>chainId</td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>filter by chainId</td></tr><tr><td>name</td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>filter by collection name</td></tr><tr><td>holders</td><td><strong>String</strong></td><td><strong>Optional</strong></td><td>filter by amount of holders</td></tr></tbody></table>

**`.onError()`**

*Action on Error: returns error information.*

**`.onComplete()`**

*Action on successful: returns `Auth_model` type.*

**`.Run()`**

*Runs the API call and fills the corresponding model in the component on success.*


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.altura.com/altura-documentation/unity-sdk-reference/get-methods/get-collections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
