List all transfers of a specific NFT
The REST API allows you to retrieve all transfers of a specific NFT by contract address and token ID with the following endpoint:
GET /networks/{chainId}/nfts/{tokenAddress}/tokens/{tokenId}/transfers
info
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/0x1A92f7381B9F03921564a437210bB9396471050C/tokens/7421/transfers' \
-H 'accept: application/json'
{
"total": 1,
"pageNumber": 1,
"pageSize": 100,
"network": "ETHEREUM",
"cursor": "string",
"account": "0x0a267cf51ef038fc00e71801f5a524aec06e4f07",
"transfers": [
{
"tokenAddress": "0x082903f4e94c5e10a2b116a4284940a36afaed63",
"tokenId": "3784",
"fromAddress": "0x4f3a17060f14a28a1b706be652879d9aea4a83c2",
"toAddress": "0x0a267cf51ef038fc00e71801f5a524aec06e4f07",
"contractType": "ERC1155",
"price": "0",
"quantity": "1",
"blockNumber": "14221791",
"blockTimestamp": "2022-02-17T05:37:06.000Z",
"blockHash": "0x75cf7d327e259b10881cc3b66a4aad56eb2ab4163cc77a6c535123938aa87b5f",
"transactionHash": "0x97af3d5fe2951a3667dc9b465eb7253682e08d7ec23759722db1732fa9583468",
"transactionType": ""
}
]
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/0x1A92f7381B9F03921564a437210bB9396471050C/tokens/7421/transfers' \
-H 'accept: application/json' \
-H 'Authorization: Basic <BASE64-STRING>'
Use NodeJS
The following example uses Node.js to make calls to the REST endpoint:
- Node.js
- 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 = "0x1A92f7381B9F03921564a437210bB9396471050C";
const tokenId = "7421";
(async () => {
try {
const { data } = await axios.get(
`https://nft.api.infura.io/networks/${chainId}/nfts/${tokenAddress}/tokens/${tokenId}/transfers`,
{
headers: {
Authorization: `Basic ${Auth}`,
},
},
);
console.log(":rocket: ~ file: index.js:20 ~ result:", data);
} catch (error) {
console.log(":rocket: ~ file: index.js:17 ~ error:", error);
}
})();
{
"total": 2,
"pageNumber": 0,
"pageSize": 100,
"network": "ETHEREUM",
"cursor": null,
"transfers": [
{
"tokenAddress": "0x1a92f7381b9f03921564a437210bb9396471050c",
"tokenId": "7421",
"fromAddress": "0xcbee390e62853b80aaae7181b205f6cf368cff7d",
"toAddress": "0x889ac1932f493e9d65749ba0a8abc2d294b0b9f4",
"contractType": "ERC721",
"price": "0",
"quantity": "1",
"blockNumber": "14112325",
"blockTimestamp": "2022-01-31T07:32:43.000Z",
"blockHash": "0xfb49fa90d01c41c2d2e246b272ec4581894a6c7f8d1137fc6862f84f8d031640",
"transactionHash": "0x0bcb54d66901212913a0367f8362a0fffd495603f8993b2a6026a41cd48c25fe",
"transactionType": "Single"
},
{
"tokenAddress": "0x1a92f7381b9f03921564a437210bb9396471050c",
"tokenId": "7421",
"fromAddress": "0x0000000000000000000000000000000000000000",
"toAddress": "0xcbee390e62853b80aaae7181b205f6cf368cff7d",
"contractType": "ERC721",
"price": "60000000000000000",
"quantity": "1",
"blockNumber": "12744471",
"blockTimestamp": "2021-07-01T22:37:47.000Z",
"blockHash": "0x66ff986034afac16f7cc2bec0712201fbeffcf13d56607385d13aa54c883d15e",
"transactionHash": "0x4eaac5c9542498240a6c92a983758193b3dbc4b6e90083251392eb4d3bf590f1",
"transactionType": "Single"
}
]
}