Trades History API

Historical trade data service that provides detailed information about token trades and wallet activities.

Overview

The Trades History API provides detailed historical trade data for specific tokens and wallet addresses. It returns a chronological list of trades with comprehensive information about each transaction, including prices, amounts, and wallet statistics.

Endpoint

GET /api/trades-history

Parameters

ParameterTypeDescription
baseTokenstringThe token address to fetch trade history for
walletsstringComma-separated list of wallet addresses to check

Response Format

Trade Object

Basic Trade Information

  • chainId: The blockchain network ID
  • blockTimestamp: Unix timestamp of the block
  • blockNumber: Block number
  • timestamp: Transaction timestamp
  • transactionHash: Hash of the transaction

Token Information

  • tokenIn: Address of the input token
  • tokenOut: Address of the output token
  • amountIn: Amount of input token
  • amountOut: Amount of output token
  • amountUSD: Transaction value in USD

Price148 Information

  • suspectedBaseTokenPrice: Price of the base token in quote token
  • suspectedBaseTokenPriceUSD: Price of the base token in USD
  • poolAddress: Address of the liquidity pool

Maker Data

  • address: Wallet address
  • currentlyHoldingAmount: Current token balance
  • holderSince: Timestamp when wallet first held the token
  • totalBoughtAmount: Total amount of tokens bought
  • tags: Array of wallet tags

Example Response

{
  "tradeHistory": [
    {
      "chainId": 1399811149,
      "blockTimestamp": 1746038772,
      "suspectedBaseTokenPrice": "0.00000004368709761023",
      "suspectedBaseTokenPriceUSD": "0.00000634882746020613",
      "poolAddress": "POOL_ADDRESS",
      "timestamp": 1746038772,
      "blockNumber": 336954350,
      "tokenIn": "TOKEN_ADDRESS",
      "tokenOut": "So11111111111111111111111111111111111111112",
      "amountIn": "9176828947917",
      "amountOut": "400909022",
      "amountUSD": "58.26210362214999",
      "transactionHash": "TRANSACTION_HASH",
      "logIndex": 3000000,
      "transactionIndex": 0,
      "makerData": {
        "chainId": 1399811149,
        "address": "WALLET_ADDRESS",
        "currentlyHoldingAmount": "9176828947916",
        "holderSince": 1746038223,
        "totalBoughtAmount": "18353657895833",
        "totalBoughtUSD": "123.32602927512501",
        "totalBuyTransactions": 2,
        "totalSellTransactions": 1,
        "totalSoldAmount": "9176828947917",
        "totalSoldUSD": "58.26210362214999",
        "tokenAddress": "TOKEN_ADDRESS",
        "totalBoughtETH": "849144695",
        "totalSoldETH": "400909022",
        "sent": "9176828947917",
        "received": "18353657895833",
        "tags": []
      },
      "nativeBalance": "1695195488"
    }
  ],
  "tokensMetadata": {}
}

Usage Examples

1. Using Node.js with fetch:

import fetch from 'node-fetch';
        
        const TOKEN_ADDRESS = 'TOKEN_ADDRESS';
        const API_KEY = 'YOUR_API_KEY';
        const WALLET_ADDRESS = 'WALLET_ADDRESS';
        const API_URL = 'https://api.solapi.live/api/trades-history';
        
        fetch(`${API_URL}?baseToken=${TOKEN_ADDRESS}&wallets=${WALLET_ADDRESS}`, {
            headers: { 'x-api-key': API_KEY }
        })
        .then(response => response.json())
        .then(data => {
            console.log('Trades Summary:');
            console.log(`Total Trades: ${data.tradeHistory.length}`);
            
            data.tradeHistory.forEach((trade, index) => {
                console.log(`\nTrade #${index + 1}:`);
                console.log('Transaction Info:');
                console.log(`Hash: ${trade.transactionHash}`);
                console.log(`Time: ${new Date(trade.timestamp * 1000).toISOString()}`);
                console.log(`Block: ${trade.blockNumber}`);
                
                console.log('\nTrade Details:');
                console.log(`Token In: ${trade.tokenIn}`);
                console.log(`Token Out: ${trade.tokenOut}`);
                console.log(`Amount In: ${trade.amountIn}`);
                console.log(`Amount Out: ${trade.amountOut}`);
                console.log(`Amount USD: $${trade.amountUSD}`);
            });
        })
        .catch(error => console.error('Error:', error));

2. Using curl:

curl "https://api.solapi.live/api/trades-history?baseToken=TOKEN_ADDRESS&wallets=WALLET_ADDRESS" \
          -H "x-api-key: YOUR_API_KEY"

Error Handling

Status CodeDescription
400Missing required parameters (baseToken or wallets)
500Internal server error

Notes

  • All amounts are returned as strings to preserve precision
  • Timestamps are in Unix format (seconds since epoch)
  • The response is sorted by timestamp in descending order
  • Token metadata is included when available
  • Native balance is provided in the smallest unit (lamports for SOL)