Skip to main content

Get NFT trades by marketplace

GEThttps://deep-index.moralis.io/api/v2/nft/:address/trades

Get trades of NFTs for a given contract and marketplace.

PATH PARAMS
addressstringrequired
The address of the NFT contract
QUERY PARAMS
chainstring
The chain to query
from_blocknumber

The minimum block number from which to get the transfers

  • Provide the param 'from_block' or 'from_date'
  • If 'from_date' and 'from_block' are provided, 'from_block' will be used.
to_blockstring
The block number to get the trades from
from_datestring

The start date from which to get the transfers (any format that is accepted by momentjs)

  • Provide the param 'from_block' or 'from_date'
  • If 'from_date' and 'from_block' are provided, 'from_block' will be used.
to_datestring

The end date from which to get the transfers (any format that is accepted by momentjs)

  • Provide the param 'to_block' or 'to_date'
  • If 'to_date' and 'to_block' are provided, 'to_block' will be used.
marketplacestring
Marketplace from which to get the trades (only OpenSea is supported at the moment)
cursorstring
The cursor returned in the previous response (used for getting the next page). Learn more on cursor pagination here.
limitnumber
The desired page size of the result.
disable_totalboolean
If the result should skip returning the total count (Improves performance).
Responses
API KEY
import Moralis  from 'moralis';
import { EvmChain } from '@moralisweb3/evm-utils';

try {
const chain = EvmChain.ETHEREUM;

const address = '0x1234567890123456789012345678901234567890';

await Moralis.start({
apiKey: 'YOUR_API_KEY',
// ...and any other configuration
});

const response = await Moralis.EvmApi.nft.getNFTTrades({
address,
chain,
});

console.log(response?.result);
} catch (e) {
console.error(e);
}

Response Example
{
"total": "2000",
"page": "2",
"page_size": "100",
"result": {
"transaction_hash": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
"token_ids": [
"15"
],
"seller_address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
"buyer_address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
"marketplace_address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
"price": "1000000000000000",
"block_timestamp": "2021-06-04T16:00:15",
"block_number": "13680123",
"block_hash": "0x4a7c916ca4a970358b9df90051008f729685ff05e9724a9dddba32630c37cb96"
}
}