> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get total item amount

> Gets the total amount of a specific item in the player's inventory.

Gets the total amount of a specific item in the player's inventory.

<CodeGroup>
  ```lua Export theme={null}
  exports['jaksam_inventory']:getTotalItemAmount(itemName, metadata)
  ```

  ```lua Example theme={null}
  -- Get total amount of bread
  local breadCount = exports['jaksam_inventory']:getTotalItemAmount('bread')

  -- Get amount of specific weapon by serial
  local weaponCount = exports['jaksam_inventory']:getTotalItemAmount('weapon_pistol', {
      serial = "ABC123"
  })
  ```
</CodeGroup>

### Parameters

| Name       | Data Type | Description                                                                                                       |
| ---------- | --------- | ----------------------------------------------------------------------------------------------------------------- |
| `itemName` | string    | The name of the item to count                                                                                     |
| `metadata` | table     | Metadata to match against when counting (if provided, only items with the same metadata AND name will be counted) |

### Return value

| Name          | Data Type | Description                                        |
| ------------- | --------- | -------------------------------------------------- |
| `totalAmount` | number    | Total amount of the item in the player's inventory |


## Related topics

- [Get total item amount](/jaksam-inventory/functions/server/get-total-item-amount.md)
- [Item added](/jaksam-inventory/hooks/on-item-added.md)
- [Client](/jaksam-inventory/functions/client/index.md)
- [Server](/jaksam-inventory/functions/server/index.md)
- [Get item from slot](/jaksam-inventory/functions/client/get-item-from-slot.md)
