Links

Get the lowest sale price of an NFT in the last 7 days.

The REST API allows you to retrieve a the lowest price of af an NFT sale during the last 7 days, using this endpoint
GET /networks/{chainId}/nfts/{tokenAddress}/tradePrice?days={days}
Refer to the reference documentation to learn more about this API.

Use cURL

Use the following curl command:
curl
Response
curl -X 'GET' \
-u <API-KEY>:<API-KEY-SECRET> \
'https://nft.api.infura.io/networks/1/nfts/0xa9cb55d05d3351dcd02dd5dc4614e764ce3e1d6e/tradePrice?days=30' \
-H 'accept: application/json'
{
"transactionHash": "0x0c930abb13c9b283bf73cdb979c8cb936bdf6189177d6f95beb892f66dc817fc",
"blockTimestamp": "2022-11-01T02:46:23.000Z",
"blockHash": "0x002096fc3b09e3b3c00fdb1d5c08cf20b442e5a99d15bdedc73ba3a2558ea132",
"blockNumber": "15872306",
"tokenIds": [
"7567"
],
"sellerAddress": "0xd279e2dd092835061fc6758d051bd78873ec7622",
"buyerAddress": "0x00000003dff73965674dbcc9dfcec53e1789ed50",
"tokenAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"marketplaceAddress": "0x00000000006c3852cbef3e08e8df289169ede581",
"price": "68100000000000000000"
}
You can also encode <API-KEY>:<API-KEY-SECRET> to Base64 string and run the command. For example, encode your API key and API key secret:
echo -n '<API-KEY>:<API-KEY-SECRET>' | base64
Run the curl command using your encoded credentials:
curl -X 'GET' \
'https://nft.api.infura.io/networks/1/nfts/0xa9cb55d05d3351dcd02dd5dc4614e764ce3e1d6e/tradePrice?days=30' \
-H 'accept: application/json' \
-H 'Authorization: Basic <BASE64-STRING>'

Use NodeJS

The following example uses NodeJS to make calls to the REST endpoint:
NodeJS
Response
index.js
const axios = require('axios');
require('dotenv').config()
const Auth =
Buffer.from(
process.env.INFURA_API_KEY + ':' + process.env.INFURA_API_KEY_SECRET,
).toString('base64');
const chainId = "1";
const tokenAddress= "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D";
const days=7;
(async() => {
try{
const {data} = await axios.get(`https://nft.api.infura.io/networks/${chainId}/nfts/${tokenAddress}/tradePrice?days=${days}`, {
headers: {
Authorization: `Basic ${Auth}`,
}
})
console.log(":rocket: ~ file: index.js:20 ~ result:", data)
}catch(error){
console.log(":rocket: ~ file: index.js:17 ~ error:", error)
}
})();
{
transactionHash: '0xff9cfbd84d4395720faae86230999d5608a8cb06234b2878fef32563c7c87504',
blockTimestamp: '2023-03-14T21:21:23.000Z',
blockHash: '0xb964b3723e1f65c296ac95e09113fb6c1520b3e8861f81c965d1a87d4924b8ff',
blockNumber: '16828826',
tokenIds: [ '985' ],
sellerAddress: '0xd64e1f3a2df4c153f26e7cb79e42673df385d239',
buyerAddress: '0xeb83e695adcac2e83f290d2d2815fc58e6491d7a',
tokenAddress: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
marketplaceAddress: '0x00000000006c3852cbef3e08e8df289169ede581',
price: '250000000000000000'
}