API ReferenceNFT APIGet NFT Market DataGet NFT trades by marketplaceVersion: 2.0Get NFT trades by marketplaceGEThttps://deep-index.moralis.io/api/v2/nft/:address/tradesGet trades of NFTs for a given contract and marketplace.PATH PARAMSaddressstringrequiredThe address of the NFT contractQUERY PARAMSchainstringThe chain to queryeth0x1goerli0x5sepolia0xaa36a7polygon0x89mumbai0x13881bsc0x38bsc testnet0x61avalanche0xa86afantom0xfapalm0x2a15c308dcronos0x19arbitrum0xa4b1from_blocknumberThe minimum block number from which to get the transfersProvide the param 'from_block' or 'from_date'If 'from_date' and 'from_block' are provided, 'from_block' will be used.to_blockstringThe block number to get the trades fromfrom_datestringThe 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_datestringThe 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.marketplacestringMarketplace from which to get the trades (only OpenSea is supported at the moment)cursorstringThe cursor returned in the previous response (used for getting the next page). Learn more on cursor pagination here.limitnumberThe desired page size of the result.disable_totalboolean⚠️ Deprecating soon. If the result should skip returning the total count (Improves performance). This parameter defaults to true.falsetrueResponses200 Returns the tradesobjectAPI KEYTest Live APINode.jsPythoncURLGoPHPimport Moralis from 'moralis';try { await Moralis.start({ apiKey: "YOUR_API_KEY" }); const response = await Moralis.EvmApi.nft.getNFTTrades({ "chain": "0x1", "marketplace": "opensea", "address": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB" }); console.log(response.raw);} catch (e) { console.error(e);}from moralis import evm_apiapi_key = "YOUR_API_KEY"params = { "chain": "eth", "marketplace": "opensea", "address": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB"}result = evm_api.nft.get_nft_trades( api_key=api_key, params=params,)print(result)curl --request GET \ --url 'https://deep-index.moralis.io/api/v2/nft/0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB/trades?chain=eth&marketplace=opensea' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://deep-index.moralis.io/api/v2/nft/0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB/trades?chain=eth&marketplace=opensea" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://deep-index.moralis.io/api/v2/nft/0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB/trades?chain=eth&marketplace=opensea', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 Returns the trades{ "total": 1, "page": "0", "page_size": "100", "cursor": "", "result": { "transaction_hash": "0x5eba5d8d84c20a7f30b92d74afaee764d9476b62a1637b017319c721269245ed", "transaction_index": "90", "token_ids": [ "1002" ], "seller_address": "0xe7f35f06a80a6a2a5edc823379fa147d9f9948a8", "buyer_address": "0xd7c708080553068217a2fe6f44eccf9cac309915", "token_address": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb", "marketplace_address": "0x7be8076f4ea4a4ad08075c2508e481d6c946d12b", "price": "18980000000000000000", "price_token_address": "0x60e4d786628fea6478f785a6d7e704777c86a7c6", "block_timestamp": "2022-03-18T22:21:07.000Z", "block_number": "14413068", "block_hash": "0x50e740dd733efc1e7252e3863e76368624d146e1a8447fab32c9697685cf581d", "verified_collection": true }}