# getPdpDataSets

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

Defined in: [packages/synapse-core/src/warm-storage/get-pdp-data-sets.ts:84](https://github.com/FilOzone/synapse-sdk/blob/aaa98045b003ec23f4318ba9a3032a434e5a20c9/packages/synapse-core/src/warm-storage/get-pdp-data-sets.ts#L84)

Get one bounded page of enriched PDP data sets.

Only the current source page is enriched, in bounded batches with source
order preserved. Pass `nextCursor` back as `cursor`; treat it as
opaque. Use [paginate](/reference/filoz/synapse-core/core/functions/paginate/) to traverse every page. Results report piece
presence from a non-zero [getDataSetLeafCount](/reference/filoz/synapse-core/pdp-verifier/functions/getdatasetleafcount/) read, which is an O(1)
storage lookup, rather than scanning piece IDs. Exact active-piece counts are
omitted because the contract's count getter performs a linear scan and can
fail for large data sets. To derive a count explicitly, traverse
[getActivePiecesByCursor](/reference/filoz/synapse-core/pdp-verifier/functions/getactivepiecesbycursor/) and count the yielded pieces.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `client` | `Client`\<`Transport`, `Chain`\> | The client to use to get data sets for a client address. |
| `options` | [`OptionsType`](/reference/filoz/synapse-core/warm-storage/namespaces/getclientdatasets/type-aliases/optionstype/) | [getPdpDataSets.OptionsType](/reference/filoz/synapse-core/warm-storage/namespaces/getpdpdatasets/type-aliases/optionstype/) |

## Returns

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

A page of PDP data set info entries [getPdpDataSets.OutputType](/reference/filoz/synapse-core/warm-storage/namespaces/getpdpdatasets/type-aliases/outputtype/)

## Throws

Errors [getPdpDataSets.ErrorType](/reference/filoz/synapse-core/warm-storage/namespaces/getpdpdatasets/type-aliases/errortype/)

## Examples

**Read the first page**

```ts
import { getPdpDataSets } from '@filoz/synapse-core/warm-storage'
import { createPublicClient, http } from 'viem'
import { calibration } from '@filoz/synapse-core/chains'

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

const address = '0x0000000000000000000000000000000000000000'
const page = await getPdpDataSets(client, { address })
console.log(page.items, page.nextCursor)
```

**Iterate over every page**

```ts
import { paginate } from '@filoz/synapse-core'
import { getPdpDataSets } from '@filoz/synapse-core/warm-storage'

for await (const dataSet of paginate(({ cursor }) =>
  getPdpDataSets(client, { address, cursor })
)) {
  console.log(dataSet.dataSetId)
}
```