Skip to main content

Transaction History

Query detailed transaction history for any wallet across multiple chains.

Try it Live

Open in Swagger UI โ†’ to test these endpoints interactively.

Endpointsโ€‹

EndpointDescriptionPrice
GET /api/wallet/:address/transactionsTransaction history$0.01
GET /api/wallet/:address/transfersToken transfers only$0.01
GET /api/wallet/:address/swapsDEX swaps$0.01
GET /api/wallet/:address/activityAggregated activity$0.02

GET /api/wallet/:address/transactionsโ€‹

Get paginated transaction history for a wallet.

Query Parametersโ€‹

ParamTypeDefaultDescription
chainstringethereumChain to query
limitnumber20Max results (1-100)
offsetnumber0Pagination offset
typestringโ€”Filter by type (see below)
startBlocknumberโ€”Start from block
endBlocknumberโ€”End at block

Transaction Typesโ€‹

TypeDescription
transferETH transfers
tokenERC-20 transfers
nftERC-721/1155 transfers
contractContract interactions
swapDEX swaps
approvalToken approvals

Requestโ€‹

curl "https://api.web3identity.com/api/wallet/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/transactions?chain=ethereum&limit=10"

Responseโ€‹

{
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"chain": "ethereum",
"transactions": [
{
"hash": "0xabc123...",
"block": 19234567,
"timestamp": "2026-02-08T12:34:56Z",
"from": "0xd8dA...",
"to": "0x1234...",
"value": "1.5",
"valueUSD": 4868.50,
"type": "transfer",
"method": null,
"gasUsed": 21000,
"gasPrice": "25.5",
"gasCost": "0.0005355",
"gasCostUSD": 1.74,
"status": "success"
},
{
"hash": "0xdef456...",
"block": 19234560,
"timestamp": "2026-02-08T12:30:00Z",
"from": "0xd8dA...",
"to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
"value": "0",
"type": "swap",
"method": "swapExactETHForTokens",
"swapDetails": {
"protocol": "Uniswap V2",
"fromToken": "ETH",
"toToken": "USDC",
"fromAmount": "2.0",
"toAmount": "6491.34",
"priceImpact": 0.12
},
"gasUsed": 150234,
"status": "success"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 523,
"hasMore": true
}
}

GET /api/wallet/:address/transfersโ€‹

Get token transfer history (ERC-20 and native transfers).

Query Parametersโ€‹

ParamTypeDefaultDescription
chainstringethereumChain to query
tokenstringโ€”Filter by token address
directionstringallin, out, or all
limitnumber50Max results
minValuenumber0Min USD value

Requestโ€‹

curl "https://api.web3identity.com/api/wallet/0xd8dA.../transfers?token=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&direction=in"

Responseโ€‹

{
"address": "0xd8dA...",
"transfers": [
{
"hash": "0xabc...",
"timestamp": "2026-02-08T12:00:00Z",
"from": "0x1234...",
"to": "0xd8dA...",
"token": {
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6
},
"amount": "5000.00",
"valueUSD": 5000.00,
"direction": "in"
}
],
"summary": {
"totalIn": 25000.00,
"totalOut": 12500.00,
"netFlow": 12500.00,
"transferCount": 42
}
}

GET /api/wallet/:address/swapsโ€‹

Get DEX swap history.

Supported DEXsโ€‹

  • Uniswap (V2, V3, V4)
  • SushiSwap
  • Curve
  • Balancer
  • 1inch
  • Paraswap
  • Cowswap
  • 0x Protocol

Requestโ€‹

curl "https://api.web3identity.com/api/wallet/0xd8dA.../swaps?limit=20"

Responseโ€‹

{
"address": "0xd8dA...",
"swaps": [
{
"hash": "0xabc...",
"timestamp": "2026-02-08T12:34:56Z",
"protocol": "Uniswap V3",
"router": "0x...",
"fromToken": {
"symbol": "ETH",
"amount": "10.0",
"valueUSD": 32456.70
},
"toToken": {
"symbol": "USDC",
"amount": "32400.00",
"valueUSD": 32400.00
},
"priceImpact": 0.17,
"slippage": 0.5,
"gasCost": "0.015",
"gasCostUSD": 48.68,
"effectivePrice": 3240.00
}
],
"summary": {
"totalSwaps": 156,
"volumeUSD": 523456.78,
"avgSlippage": 0.34,
"totalGasCostUSD": 1234.56
}
}

GET /api/wallet/:address/activityโ€‹

Aggregated wallet activity summary.

Requestโ€‹

curl "https://api.web3identity.com/api/wallet/0xd8dA.../activity?days=30"

Responseโ€‹

{
"address": "0xd8dA...",
"period": {
"days": 30,
"startDate": "2026-01-09",
"endDate": "2026-02-08"
},
"activity": {
"totalTransactions": 523,
"uniqueAddresses": 89,
"volumeUSD": 245678.90,
"gasSpentUSD": 1234.56,
"avgGasPerTx": 2.36
},
"breakdown": {
"transfers": {
"count": 234,
"volumeUSD": 123456.78
},
"swaps": {
"count": 156,
"volumeUSD": 98765.43
},
"nftTrades": {
"count": 12,
"volumeUSD": 23456.69
},
"approvals": {
"count": 45
},
"contractInteractions": {
"count": 76
}
},
"topProtocols": [
{ "name": "Uniswap", "interactions": 89, "volumeUSD": 67890.12 },
{ "name": "Aave", "interactions": 34, "volumeUSD": 45678.90 },
{ "name": "OpenSea", "interactions": 12, "volumeUSD": 23456.69 }
],
"chain": "ethereum",
"lastActive": "2026-02-08T12:34:56Z"
}

SDK Examplesโ€‹

JavaScriptโ€‹

import { Web3IdentityClient } from '@web3identity/sdk';

const client = new Web3IdentityClient();

// Get recent transactions
const txs = await client.getTransactions('vitalik.eth', {
chain: 'ethereum',
limit: 20,
type: 'swap'
});

console.log(`Found ${txs.transactions.length} swaps`);

// Get token transfers
const transfers = await client.getTransfers('vitalik.eth', {
token: 'USDC',
direction: 'in',
minValue: 1000
});

// Get activity summary
const activity = await client.getWalletActivity('vitalik.eth', {
days: 30
});

console.log(`Total volume: $${activity.activity.volumeUSD.toLocaleString()}`);
console.log(`Gas spent: $${activity.activity.gasSpentUSD.toFixed(2)}`);

React Componentโ€‹

import { useState, useEffect } from 'react';

function TransactionHistory({ address }: { address: string }) {
const [txs, setTxs] = useState([]);
const [loading, setLoading] = useState(true);

useEffect(() => {
const fetchTxs = async () => {
const res = await fetch(
`https://api.web3identity.com/api/wallet/${address}/transactions?limit=10`
);
const data = await res.json();
setTxs(data.transactions);
setLoading(false);
};

fetchTxs();
}, [address]);

if (loading) return <div>Loading transactions...</div>;

return (
<div className="tx-history">
<h3>Recent Transactions</h3>
{txs.map(tx => (
<div key={tx.hash} className="tx-item">
<span className="tx-type">{tx.type}</span>
<span className="tx-value">${tx.valueUSD?.toFixed(2)}</span>
<span className="tx-time">
{new Date(tx.timestamp).toLocaleDateString()}
</span>
<a
href={`https://etherscan.io/tx/${tx.hash}`}
target="_blank"
rel="noopener"
>
View โ†’
</a>
</div>
))}
</div>
);
}

Pythonโ€‹

from web3identity import Client

client = Client()

# Get transactions
txs = client.get_transactions(
'0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
chain='ethereum',
limit=50,
type='swap'
)

# Calculate total swap volume
total_volume = sum(
tx.get('swapDetails', {}).get('toAmount', 0)
for tx in txs['transactions']
)

print(f"Total swap volume: ${total_volume:,.2f}")

# Get token transfers
transfers = client.get_transfers(
'vitalik.eth',
token='USDC',
direction='in'
)

print(f"Total USDC received: ${transfers['summary']['totalIn']:,.2f}")

cURL Examplesโ€‹

# Get recent transactions
curl "https://api.web3identity.com/api/wallet/0xd8dA.../transactions?limit=10"

# Get swaps only
curl "https://api.web3identity.com/api/wallet/0xd8dA.../transactions?type=swap"

# Get USDC transfers
curl "https://api.web3identity.com/api/wallet/0xd8dA.../transfers?token=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"

# Get activity summary
curl "https://api.web3identity.com/api/wallet/0xd8dA.../activity?days=30"

# Filter by block range
curl "https://api.web3identity.com/api/wallet/0xd8dA.../transactions?startBlock=19000000&endBlock=19100000"

Paginationโ€‹

For large transaction histories, use offset-based pagination:

async function getAllTransactions(address, type = null) {
const allTxs = [];
let offset = 0;
const limit = 100;
let hasMore = true;

while (hasMore) {
const params = new URLSearchParams({
limit: limit.toString(),
offset: offset.toString()
});

if (type) params.set('type', type);

const response = await fetch(
`https://api.web3identity.com/api/wallet/${address}/transactions?${params}`
);
const data = await response.json();

allTxs.push(...data.transactions);
hasMore = data.pagination.hasMore;
offset += limit;
}

return allTxs;
}

// Get all swap transactions
const swaps = await getAllTransactions('vitalik.eth', 'swap');
console.log(`Total swaps: ${swaps.length}`);

Analysis Examplesโ€‹

Calculate Net Flowโ€‹

async function calculateNetFlow(address, days = 30) {
const activity = await fetch(
`https://api.web3identity.com/api/wallet/${address}/activity?days=${days}`
).then(r => r.json());

const netFlow =
activity.breakdown.transfers.volumeUSD -
activity.breakdown.swaps.volumeUSD;

return {
inflow: activity.breakdown.transfers.volumeUSD,
outflow: activity.breakdown.swaps.volumeUSD,
net: netFlow,
gasSpent: activity.activity.gasSpentUSD
};
}

const flow = await calculateNetFlow('0xd8dA...', 30);
console.log(`Net flow: $${flow.net.toLocaleString()}`);

Track Protocol Usageโ€‹

async function getProtocolInteractions(address, protocol) {
const txs = await fetch(
`https://api.web3identity.com/api/wallet/${address}/transactions?limit=100`
).then(r => r.json());

const protocolTxs = txs.transactions.filter(tx =>
tx.swapDetails?.protocol.toLowerCase().includes(protocol.toLowerCase())
);

return {
count: protocolTxs.length,
volume: protocolTxs.reduce((sum, tx) =>
sum + (tx.swapDetails?.toAmount || 0), 0
)
};
}

const uniswapStats = await getProtocolInteractions('0xd8dA...', 'uniswap');
console.log(`Uniswap: ${uniswapStats.count} swaps, $${uniswapStats.volume.toFixed(2)}`);

Gas Spending Analysisโ€‹

import requests
from datetime import datetime, timedelta

def analyze_gas_spending(address: str, days: int = 30):
url = f"https://api.web3identity.com/api/wallet/{address}/transactions"
params = {"limit": 100}

response = requests.get(url, params=params)
data = response.json()

# Calculate gas metrics
gas_costs = [tx['gasCostUSD'] for tx in data['transactions']]

return {
'total_gas': sum(gas_costs),
'avg_gas': sum(gas_costs) / len(gas_costs),
'max_gas': max(gas_costs),
'min_gas': min(gas_costs),
'tx_count': len(gas_costs)
}

stats = analyze_gas_spending('0xd8dA...')
print(f"Avg gas per tx: ${stats['avg_gas']:.4f}")
print(f"Most expensive tx: ${stats['max_gas']:.2f}")

Rate Limitsโ€‹

Transaction history endpoints count toward your daily quota:

TierRequests/DayCost per Request
Free100N/A
Hobby10,000$0.01
Pro100,000$0.008
EnterpriseUnlimitedCustom