> For the complete documentation index, see [llms.txt](https://docs.altura.com/altura-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.altura.com/altura-documentation/js-sdk-reference/get-methods/get-collections.md).

# Get Collections

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

### Usage in your script

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const response = await altura.getCollections();

// customize options
const response = await altura.getCollections({
  perPage: 20,
  page: 1,
  sortBy: 'name',
  sortDir: 'asc'
});

// filter documents by any properties
const response = await altura.getCollections(
  {}, // Default pagination
  {
    isVerified: true
  } // fetching verified collections only
);

const collections = response.collections;
const collectionCount = response.count;
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const response: { collections: IAlturaCollection[], count: number } = await altura.getCollections();

// customize options
const response: { collections: IAlturaCollection[], count: number } = await altura.getCollections({
  perPage: 20,
  page: 1,
  sortBy: 'name',
  sortDir: 'asc'
});

// filter documents by any properties
const response: { collections: IAlturaCollection[], count: number } = await altura.getCollections(
  {}, // Default pagination
  {
    isVerified: true
  } // fetching verified collections only
);

const collections = response.collections;
const collectionCount = response.count;
```

{% endtab %}
{% endtabs %}

### **Parameters**

<table><thead><tr><th width="193.33333333333331">Parameter</th><th width="138">Type</th><th width="109">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>perPage</code></td><td>number</td><td><strong>Optional</strong></td><td>The number of collections to return</td></tr><tr><td><code>page</code></td><td>number</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>"asc" | "desc"</td><td><strong>Optional</strong></td><td>Choose to sort in ascending (asc) or descending (desc) order</td></tr></tbody></table>
