Working with the GetNFTsForContract API

Hi there! looking for some help on utilizing this API, here’s my output in console.

ParseUser {id: '6ovKQJ2fcxVwiTzSpF9BirRg', _objCount: 0, className: '_User'}
main.js:12 0x081a9a711ebeb35f115ffc7130cc80e92241c759
const options = { chain: "eth", address: "hidden", token_address: "hidden" };
undefined
await Moralis.Web3API.account.getNFTsForContract(options);
{total: 31, page: 0, page_size: 500, result: Array(31), status: 'SYNCED'}


The API appears to be working, and pulling from the options variable defined above it. Is it possible to then retrieve/communicate with the specific results that the API provided? Specifically the ‘total’ given by the API would be great to use, but I’m unsure on how to call it.

Thanks!

Hey @juno, at the moment there’s no way to filter the result for the Web3 API, also I don’t think you can modify total as it is counting the number of elements inside of result array :raised_hands:

Cheers~

ah alright, yeah the ‘total’ value is the correct number of NFT’s in the wallet, wanted to use that to give/restrict access to parts of the dapp. Thanks!

if you want only to read that total value, there isn’t a super easy way now, but you can make the query with limit of 1 so it is faster and read the total