<p>You could do something like:</p>
<pre><code>let assets = [];
let final = false;
let page = 1;

while (final !== true) {
  const req = await get_function(url, page);
  assets = [...assets, ...req.data];
  page++;
  if (req.data.length &lt; 100) {
    final = true;
  }
}
</code></pre>

CC BY-SA 4.0
2022-09-06T17:27:15.117Z
2022-09-06T17:27:47.973Z
2022-09-06T17:27:47.973Z
3ntr0py
<p>For context, I'm trying to get all NFTs with a policy id, but only from a wallet address. I'm using BlockFrost OpenAPI, and it seems that I can only get assets with a policy id from the entire blockchain?? Using this url : 'https://cardano-mainnet.blockfrost.io/api/v0/assets/policy/{policy_id}'</p>
<p>I tried to filter the assets from this url response : <code>https://cardano-mainnet.blockfrost.io/api/v0/accounts/{stake_address}/addresses/assets</code>
but I only can get 100 assets per page, and I get no info about how much page there is. They explicitly says on the doc that the count is from 0 to 100.</p>

<nft><api><blockfrost>
How to get assets with a specifc policy id from a wallet address using BlockFrost OpenAPI
# How to get assets with a specifc policy id from a wallet address using BlockFrost OpenAPI

(Asked by: username_0 on 2022-04-16)

For context, I'm trying to get all NFTs with a policy id, but only from a wallet address. I'm using BlockFrost OpenAPI, and it seems that I can only get assets with a policy id from the entire blockchain?? Using this url : 'https://cardano-mainnet.blockfrost.io/api/v0/assets/policy/{policy\_id}'

I tried to filter the assets from this url response : `https://cardano-mainnet.blockfrost.io/api/v0/accounts/{stake_address}/addresses/assets`
but I only can get 100 assets per page, and I get no info about how much page there is. They explicitly says on the doc that the count is from 0 to 100.

**Tags:** nft, api, blockfrost

---

## 1 answers

### Answer by username_1 on 2022-09-06. Score: 1

You could do something like:
let assets = [];
let final = false;
let page = 1;

while (final !== true) {
  const req = await get_function(url, page);
  assets = [...assets, ...req.data];
  page++;
  if (req.data.length < 100) {
    final = true;
  }
}


---

