Get Holder Transactions
Retrieve a comprehensive transaction history for a holder, including buys, sells, deposits, withdrawals, airdrops, and transfers.
GETapi.metal.build/holder/:userId/transactions
Get holder transactions
This endpoint returns a comprehensive transaction history for a holder, including all token transfers classified by their context and purpose.
Path parameters
- Name
userId
- Type
- string
- Description
The unique identifier for the holder whose transaction history you want to retrieve.
Response attributes
- Name
transactions
- Type
- array
- Description
Array of transaction objects representing the holder's transaction history.
- Name
context
- Type
- string
- Description
The classification of the transaction. Possible values:
"Buy"
- Token purchase via swap"Sell"
- Token sale via swap"Deposit"
- Direct token deposit to wallet"Withdraw"
- Token withdrawal from wallet"Airdrop"
- Token received via airdrop mechanism"Transfer"
- General token transfer
- Name
tokenName
- Type
- string
- Description
The human-readable name of the token.
- Name
tokenAddress
- Type
- string
- Description
The token address.
- Name
tokenAmount
- Type
- string
- Description
The amount of tokens involved in the transaction.
- Name
transactionHash
- Type
- string
- Description
The transaction hash.
- Name
total
- Type
- number
- Description
The total number of transactions found for this holder.
Request
GET
api.metal.build/holder/:userId/transactionsconst response = await fetch('https://api.metal.build/holder/user123/transactions', {
method: 'GET',
headers: {
'x-api-key': 'YOUR_SECRET_API_KEY',
}
});
const data = await response.json();
Response
{
"transactions": [
{
"context": "Withdraw",
"tokenName": "USDC",
"tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"tokenAmount": "119.00",
"transactionHash": "0x7d25f282aa160a533f815a7ar12c166c9249439b295e46ae0e6c1d58ded0cb65"
},
{
"context": "Sell",
"tokenName": "TestCoin",
"tokenAddress": "0x12f5ea27505a92a5ad167e4e8d96f31c10b8b3fd",
"tokenAmount": "7213.00",
"transactionHash": "0x1f16e28d3bf34b34dadb1ba9a62de2a01a1harf94588de67a645c5a72fe35282"
},
{
"context": "Deposit",
"tokenName": "USDC",
"tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"tokenAmount": "117.00",
"transactionHash": "0x9e259c49dcb2312d2934af10a75f465cd9c253c301b581b0mq31lced719dc982"
}
],
"total": 3
}