Discussions

Ask a Question
Back to All

NFT not returning transfer history

I am using this endpoint (https://docs.alchemy.com/reference/getnftsales) to query the transfer history of NFTs for a wallet that I am building. It works fine with one of my NFTs, but with the other two it just returns an empty array. I was wondering what might cause this. The one that works is from "Down Market Ducks" and the two that don't work are from "OpenStore." Any help with this would be appreciated. I can provide any additional info that would help. I'll at least include my function that returns the data below.

export const getNFTSalesHistory = async (contractAddress, tokenId) => {
    const apiKey = '<my-key>';
    const url = `https://eth-mainnet.g.alchemy.com/nft/v2/${apiKey}/getNFTSales?fromBlock=0&toBlock=latest&order=desc&contractAddress=${contractAddress}&tokenId=${tokenId}`;
    const options = {
        method: 'GET',
        headers: {
            accept: 'application/json',
        }
    }
    const salesData = await fetch(url, options);
    const salesJsonData = await salesData.json();
    return salesJsonData;
}

Start typing markdown or type / to insert a block