Web3API getNFTs not filter by token_address

I’m trying get the NFTs of the user, and the below code worked:

var options = {
  "chain": "0x38",
  "address": "0x528f9aa69103d037cde9b39de64d5685e7086bde",
  "token_address": "0x8d320c1b4ef3ace907910fa6a6999d9fd55c4f21",
}

var NFTs = await Moralis.Web3API.account.getNFTs(options);

But from yesterday, we’re unable to filter by token_address. getNFTs return all NFTs of that users. Please help check, @cryptokid.

Thank so much.

1 Like

you should use this syntax:

options = {
  "chain": "0x38",
  "address": "0x528f9aa69103d037cde9b39de64d5685e7086bde",
  "token_address": "0x8d320c1b4ef3ace907910fa6a6999d9fd55c4f21",
}

NFTs = await Moralis.Web3API.account.getNFTsForContract(options);

there is a similar syntax for getNFTs too

I know that it worked the syntax that you were using too, still trying to find out why it stopped working

Do you find the reason why it stopped working, @cryptokid?

Not yet. You should use the syntax that I pasted or use token_addresses instead of token_address.

@cryptokid

I tried “getnftsforcontract” but it give me error: TypeError: Moralis.Web3API.account.getnftsforcontract is not a function

This is the exact name.
Try with token_addresses instead of token_address for getNFTs. You only have to add two letters: es, that is all.