The Wallet API is in Beta. Endpoints and response formats may change.
Overview
The Transaction History endpoint retrieves the complete transaction history for a Solana wallet using the Enhanced Transactions API. It returns human-readable, parsed transactions with balance changes for each transaction, in reverse chronological order (newest first). The endpoint returns up to 100 transactions per request, so pagination is manual. Use thebefore parameter with pagination.nextCursor to fetch the next page, and read pagination.hasMore to know when more results are available. Each request is a single API call and costs 100 credits.
The tokenAccounts parameter controls whether transactions involving token accounts owned by the wallet are included:
balanceChanged(recommended): includes transactions that changed token account balances, filtering spam.none: only direct wallet interactions.all: all token account transactions, including spam.
When to use this
Use the Transaction History API when you need to:- Display a transaction feed: show users their complete transaction history.
- Calculate PnL: track gains and losses across all transactions.
- Tax and accounting: generate complete transaction reports for tax filing.
- Portfolio analytics: analyze trading patterns and activity.
- Audit trails: maintain complete records of wallet activity.
- Balance reconstruction: rebuild current balances from historical data.
Quickstart
Basic history query
Get the most recent transactions with balance changes:- JavaScript
- Python
- cURL
Pagination for complete history
Fetch all transactions using pagination with thebefore parameter:
- JavaScript
- Python
Query parameters
Available transaction types
Thetype parameter supports filtering by these transaction types:
SWAP, TRANSFER, NFT_SALE, NFT_BID, NFT_LISTING, NFT_MINT, NFT_CANCEL_LISTING, TOKEN_MINT, BURN, COMPRESSED_NFT_MINT, COMPRESSED_NFT_TRANSFER, COMPRESSED_NFT_BURN, CREATE_STORE, WHITELIST_CREATOR, ADD_TO_WHITELIST, REMOVE_FROM_WHITELIST, AUCTION_MANAGER_CLAIM_BID, EMPTY_PAYMENT_ACCOUNT, UPDATE_PRIMARY_SALE_METADATA, ADD_TOKEN_TO_VAULT, ACTIVATE_VAULT, INIT_VAULT, INIT_BANK, INIT_STAKE, MERGE_STAKE, SPLIT_STAKE, CREATE_AUCTION_MANAGER, START_AUCTION, CREATE_AUCTION_MANAGER_V2, UPDATE_EXTERNAL_PRICE_ACCOUNT, EXECUTE_TRANSACTION
Filter examples
- Filter by Type
- Token Accounts Filter
- Combined Filters
Response format
Field notes
timestamp: Unix seconds. May benullfor very recent transactions that haven’t been fully processed yet.error:nullfor successful transactions; an error value for failed ones. Failed transactions still incur fees.balanceChanges: how the wallet’s holdings changed in the transaction — a positiveamountis tokens received, a negativeamountis tokens sent or spent.mint(withinbalanceChanges): token mint address, or"SOL"for native SOL.amount(withinbalanceChanges): human-readable, already divided bydecimals—-0.05means −0.05 SOL, not −0.05 lamports. This endpoint does not include a rawamountRawfield.
Example balance changes
Use cases
Calculate total trading volume
Sum all transfers to get trading volume:Generate a tax report
Create a transaction report for tax filing:Track failed transactions
Find all failed transactions to understand errors:Reconstruct a historical balance
Calculate what the balance was at a specific point in time:Analyze transaction fees
Calculate total fees paid:Best practices
- Use pagination for complete history. Some wallets have hundreds of thousands of transactions; always paginate when fetching all of them.
- Cache historical data. Historical transactions never change. Cache them locally and only fetch new transactions.
- Handle failed transactions. Check the
errorfield to distinguish successful from failed transactions. Failed transactions still incur fees. - Use timestamps for date filtering. Timestamps are in Unix seconds. Convert to local dates for display and filtering.
Common errors
Next steps
Token Transfers
A transfer-only view with sender/recipient info — simpler than full history.
Wallet API Overview
All Wallet API endpoints and shared conventions.
API Reference
Request and response schemas for transaction history.