NFT API getNFTTrades with provided blocknumbers not working

When I query the getNFTTrades with a blocknumber range (from_block / to_block) I dont get any results.

If I only set “to_block” I get results.
If I only set “from_block” I dont get results.

What am I doing wrong, or is this API broken?

console.log(await Parse.Cloud.run("getNFTTrades",{token_address:"0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", block_number:14659015}))
Moralis.Cloud.define("getNFTTrades", async request => {
  const token_address = request.params.token_address;
  const block_number = request.params.block_number;

  try {
    const options = {
      address: token_address,
      chain: "Eth",
      from_block: block_number, 
      to_block: block_number  
    };
    const NFTTrades = await Moralis.Web3API.token.getNFTTrades(options);
    return NFTTrades;
  } catch (error) {
    logger.info("Error: " + JSON.stringify(error));
  }
});
options = {
      address: "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
      chain: "Eth",
      from_block: 0, 
      //to_block: 14659015  
    };
    NFTTrades = await Moralis.Web3API.token.getNFTTrades(options)

=> total: 14522

I only want nfttrades for the block number I provide, so from and to must be equal which doesnt give me any results back

maybe there were no trades in that specific block number

but I have an EthNFTTransfer with that blocknumber

https://docs.moralis.io/moralis-dapp/web3-sdk/token#getnfttrades

this API endpoint processes only the trades from opensea marketplace, not for any nft transfer

1 Like