Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get Swaps by Token Address

Ethereum Logo

Looking for swaps by token address on EVM?

Access token swap data by token address using our EVM API.

Explore EVM API
GEThttps://solana-gateway.moralis.io/token/:network/:tokenAddress/swaps

Get all swap related transactions (buy, sell) for a specific token address.

PATH PARAMS
networkstringrequired
The network to query
tokenAddressstringrequired
The address of the token
QUERY PARAMS
fromDatestring

The 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.
toDatestring

The 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.
cursorstring
The cursor returned in the previous response (used for getting the next page)
limitnumber
The number of results to return
orderstring
The order of the result, in ascending (ASC) or descending (DESC)
transactionTypesstring
Transaction types to fetch. Possible values: 'buy','sell'
Responses
API KEY
// Dependencies to install:
// $ npm install node-fetch --save
// add "type": "module" to package.json

import fetch from 'node-fetch';

const options = {
method: 'GET',
headers: {
accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
};

fetch('https://solana-gateway.moralis.io/token/mainnet/EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm/swaps?order=DESC', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
{
"cursor": "",
"page": 1,
"pageSize": 100,
"result": [
{
"transactionHash": "5aQsHeSC3hqsNKhk1NNfBCX8cGEmQNwLb58rQQXifdpRLeLA84KiNdf9Bun3ySPjmYTeWiE8RoH4rsKCEPQsPnD9",
"transactionIndex": 225,
"transactionType": "sell",
"baseQuotePrice": "71.400663877",
"blockTimestamp": "2024-12-05T09:27:57.000Z",
"blockNumber": 305532588,
"subCategory": "partialSell",
"walletAddress": "HeVbY7DnpmdPsp3dHPs9uewW1VZtzS2Ng8jf3UX5mexv",
"pairAddress": "4mMDQ5kG9fFrBSQeedErsUoTBhY5KKnsKWGvenXRTwSy",
"pairLabel": "$WIF/SOL",
"exchangeName": "Raydium CLMM",
"exchangeAddress": "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK",
"exchangeLogo": "https://entities-logos.s3.amazonaws.com/raydium.png",
"baseToken": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"quoteToken": "So11111111111111111111111111111111111111112",
"bought": {
"address": "So11111111111111111111111111111111111111112",
"amount": "0.046709315",
"usdPrice": 235.994560973,
"usdAmount": 11.023144286774563,
"symbol": "SOL",
"logo": "",
"name": "Wrapped SOL",
"tokenType": "token0"
},
"sold": {
"address": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"amount": "3.367337000",
"usdPrice": 3.30521522,
"usdAmount": 11.12977350326914,
"symbol": "$WIF",
"logo": "https://bafkreibk3covs5ltyqxa272uodhculbr6kea6betidfwy3ajsav2vjzyum.ipfs.nftstorage.link",
"name": "dogwifhat",
"tokenType": "token1"
},
"totalValueUsd": 11.129773503
}
]
}