API ReferenceToken APIGet Token SwapsGet Swaps by Wallet AddressVersion: 2.2Get Swaps by Wallet AddressLooking for swaps by wallet address on EVM?Access swaps by wallet address data using our EVM API.Explore EVM APIGEThttps://solana-gateway.moralis.io/account/:network/:walletAddress/swapsGet all swap related transactions (buy, sell) for a specific wallet address.PATH PARAMSnetworkstringrequiredThe network to querymainnetdevnetwalletAddressstringrequiredThe address of the walletQUERY PARAMSfromDatestringThe starting date (format in seconds or datestring accepted by momentjs)Provide the param 'fromBlock' or 'fromDate'If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.toDatestringThe ending date (format in seconds or datestring accepted by momentjs)Provide the param 'toBlock' or 'toDate'If 'toDate' and 'toBlock' are provided, 'toBlock' will be used.cursorstringThe cursor returned in the previous response (used for getting the next page)limitnumberThe number of results to returnorderstringThe order of the result, in ascending (ASC) or descending (DESC)ASCDESCtransactionTypesstringTransaction types to fetch. Possible values: 'buy','sell' or both separated by commatokenAddressstringToken address to get transactions forResponses200 Returns swap transactions by wallet address.objectAPI KEYTest Live APINode.jsPythoncURLGoPHP// Dependencies to install:// $ npm install node-fetch --save// add "type": "module" to package.jsonimport fetch from 'node-fetch';const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' },};fetch('https://solana-gateway.moralis.io/account/mainnet/6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v/swaps?order=DESC', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));# Dependencies to install:# $ python -m pip install requestsimport requestsurl = "https://solana-gateway.moralis.io/account/mainnet/6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v/swaps?order=DESC"headers = { "Accept": "application/json", "X-API-Key": "YOUR_API_KEY"}response = requests.request("GET", url, headers=headers)print(response.text)curl --request GET \ --url 'https://solana-gateway.moralis.io/account/mainnet/6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v/swaps?order=DESC' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://solana-gateway.moralis.io/account/mainnet/6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v/swaps?order=DESC" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://solana-gateway.moralis.io/account/mainnet/6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v/swaps?order=DESC', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 Returns swap transactions by wallet address.{ "cursor": "", "page": 1, "pageSize": 100, "result": [ { "transactionHash": "5KweZ2jJsfeyYdjZBsQdntbaxcH4EhSqbeWxLZsDDMCuqTmQJEqA2etZzrrgSuoRVLP7oqxk5jmKzUZnVf4Q37h5", "transactionIndex": 195, "transactionType": "buy", "baseQuotePrice": "0.000001180", "blockTimestamp": "2024-12-04T09:59:07.000Z", "blockNumber": "", "subCategory": "accumulation", "walletAddress": "6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v", "pairAddress": "4w2iPn26d9UJAbQpoaAw34iFPta53fq6KvHr3cGfYsxa", "pairLabel": "SANTA/SOL", "exchangeName": "Raydium AMM v4", "exchangeAddress": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8", "exchangeLogo": "https://entities-logos.s3.amazonaws.com/raydium.png", "baseToken": "J8uZpXLyrmaPawRFdu81byzRSLqnurTvhQ9nd2ZLVQvE", "quoteToken": "So11111111111111111111111111111111111111112", "bought": { "address": "J8uZpXLyrmaPawRFdu81byzRSLqnurTvhQ9nd2ZLVQvE", "amount": "84006.619895709", "usdPrice": 0.000278171, "usdAmount": 23.368205463009268, "symbol": "SANTA", "logo": "https://gateway.irys.xyz/4teQlB8gGU-G_RfqUOiK3gg9h3VelCt_rFcl7dlzrQg", "name": "santawifhat", "tokenType": "token0" }, "sold": { "address": "So11111111111111111111111111111111111111112", "amount": "0.099150000", "usdPrice": 235.686180744, "usdAmount": 23.368284820767602, "symbol": "SOL", "logo": "", "name": "Wrapped SOL", "tokenType": "token1" }, "totalValueUsd": 23.36828482 } ]}