# getDataSetLeafCounts

> **getDataSetLeafCounts**(`client`, `options`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`OutputType`](/reference/filoz/synapse-core/pdp-verifier/namespaces/getdatasetleafcounts/type-aliases/outputtype/)\>

Defined in: [packages/synapse-core/src/pdp-verifier/get-data-set-leaf-counts.ts:52](https://github.com/FilOzone/synapse-sdk/blob/0c729dad461472f017e4d84f8e6ac16e6afbe7c0/packages/synapse-core/src/pdp-verifier/get-data-set-leaf-counts.ts#L52)

Get the PDP leaf counts for one or more data sets via a single multicall.

A data set that is not live is represented by `0n`, matching
[getDataSetLeafCount](/reference/filoz/synapse-core/pdp-verifier/functions/getdatasetleafcount/). Duplicate IDs are read once. The returned leaf
counts are not converted to byte sizes, so callers can aggregate counts
before applying pricing conversions.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `client` | `Client`\<`Transport`, `Chain`\> | The client to use to get the data set leaf counts. |
| `options` | [`OptionsType`](/reference/filoz/synapse-core/pdp-verifier/namespaces/getdatasetleafcounts/type-aliases/optionstype/) | [getDataSetLeafCounts.OptionsType](/reference/filoz/synapse-core/pdp-verifier/namespaces/getdatasetleafcounts/type-aliases/optionstype/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`OutputType`](/reference/filoz/synapse-core/pdp-verifier/namespaces/getdatasetleafcounts/type-aliases/outputtype/)\>

Leaf counts indexed by data set ID [getDataSetLeafCounts.OutputType](/reference/filoz/synapse-core/pdp-verifier/namespaces/getdatasetleafcounts/type-aliases/outputtype/)

## Throws

Errors [getDataSetLeafCounts.ErrorType](/reference/filoz/synapse-core/pdp-verifier/namespaces/getdatasetleafcounts/type-aliases/errortype/)

## Example

```ts
import { getDataSetLeafCounts } from '@filoz/synapse-core/pdp-verifier'
import { calibration } from '@filoz/synapse-core/chains'
import { createPublicClient, http } from 'viem'

const client = createPublicClient({
  chain: calibration,
  transport: http(),
})

const leafCounts = await getDataSetLeafCounts(client, {
  dataSetIds: [1n, 2n, 3n],
})

console.log(leafCounts.get(1n))
```