# Get a User's Items

Use this method to get the items of a specific user.

### Usage in your script

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

```javascript
const response = await alturaUser.getItems();

// customize options
const response = await alturaUser.getItems({
  perPage: 20,
  page: 1,
  sortBy: 'mintDate',
  sortDir: 'desc',
  includeListed: false,
  slim: true,
});

// filter documents by any properties
const response = await alturaUser.getItems(
  {}, // default options
  {
    collectionAddress: "0xdb0047cb1dfc44696f6e9868ef6bb40000280b05"
  } // fetching items with the specified collection address only
)

const items = response.items;
const itemCount = response.count;
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const response: { items: IAlturaItem[], count: number } = await alturaUser.getItems();

// customize options
const response: {items: IAlturaItem[], count: number} = await alturaUser.getItems({
  perPage: 20,
  page: 1,
  sortBy: 'mintDate',
  sortDir: 'desc',
  includeListed: false;
  slim: true;
  stateOnly: false;
});

// filter documents by any properties
const response: {items: IAlturaItem[], count: number} = await alturaUser.getItems(
  {}, // default options
  {
    collectionAddress: "0xdb0047cb1dfc44696f6e9868ef6bb40000280b05"
  } // fetching items with the specified collection address only
)

const items = response.items;
const itemCount = response.count;
```

{% endtab %}
{% endtabs %}

### **Parameters**

<table><thead><tr><th width="208.33333333333331">Parameter</th><th width="129">Type</th><th width="109">Required</th><th>Description</th></tr></thead><tbody><tr><td>perPage</td><td>number</td><td><strong>Optional</strong></td><td>The number of items to return</td></tr><tr><td>page</td><td>number</td><td><strong>Optional</strong></td><td>The offset for returned items. Calculated as (page - 1) * perPage</td></tr><tr><td>sortBy</td><td>string</td><td><strong>Optional</strong></td><td>The field to sort the items by (any field in the item schema may be used)</td></tr><tr><td>sortDir</td><td>asc' | 'desc'</td><td><strong>Optional</strong></td><td>Choose to sort in ascending (asc) or descending (desc) order</td></tr><tr><td>includeLIsted</td><td>boolean</td><td><strong>Optional</strong></td><td>If the user's listed NFTs should be included (listed NFTs are still owned by the user, however on the blockchain they are held by a marketplace smart contract)</td></tr><tr><td>slim</td><td>boolean</td><td><strong>Optional</strong></td><td>Returns a more condensed version of the items. Limits the item schema to: name, properties, tokenId, collectionAddress, supply, maxSupply, image, imageUrl, imageIndex, and imageCount</td></tr></tbody></table>


---

# 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/js-sdk-reference/get-methods/get-a-users-items.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.
