API ReferenceToken APIGet Token SwapsGet Swaps by Token AddressGet Swaps by Token Address Mainnet OnlyLooking for swaps by token address on EVM?Access token swap data by token address using our EVM API.Explore EVM APIGEThttps://solana-gateway.moralis.io/token/:network/:address/swapsGet all swap related transactions (buy, sell) for a specific token address.NoteSwaps data is synced and available only from September 2024 onwards. Data prior to this date is not included.PATH PARAMSnetworkstringrequiredThe network to queryaddressstringrequiredThe address to queryQUERY PARAMSlimitnumberThe limit per pagecursorstringThe cursor to the next pagefromDatestringThe starting date (format in seconds or datestring accepted by momentjs)toDatestringThe ending date (format in seconds or datestring accepted by momentjs)orderstringThe order of the results, in ascending (ASC) or descending (DESC).transactionTypesstringTransaction types to fetch. Possible values: 'buy','sell' or both separated by commaResponses200400Bad Request404Not Found429Too Many Requests500Internal Server ErrorAPI KEYTest Live APIcURLNode.jsPythonGoPHPcurl --request GET \ --url 'https://solana-gateway.moralis.io/token/mainnet/So11111111111111111111111111111111111111112/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' // Node.js v18+ has native fetch support// No additional dependencies requiredconst options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' },};fetch('https://solana-gateway.moralis.io/token/mainnet/So11111111111111111111111111111111111111112/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell', 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/token/mainnet/So11111111111111111111111111111111111111112/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell"headers = { "Accept": "application/json", "X-API-Key": "YOUR_API_KEY"}response = requests.request("GET", url, headers=headers)print(response.text)package mainimport ( "fmt" "net/http" "io")func main() { url := "https://solana-gateway.moralis.io/token/mainnet/So11111111111111111111111111111111111111112/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell" 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, _ := io.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/token/mainnet/So11111111111111111111111111111111111111112/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 { "page": 1, "pageSize": 100, "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Caaw", "result": { "transactionHash": "0xafc66b9b1802618f560be5244395f0fc0b95a1f1fdeee7a206acbb546c9e8a72", "transactionIndex": 5, "transactionType": "buy", "blockNumber": 12345678, "blockTimestamp": "2024-11-21T09:22:28.000Z", "subCategory": "ACCUMULATION", "walletAddress": "0x1c584a6baecb7c5d51caa0ef3a579e08bd49d4e5", "pairAddress": "0xdded227d71a096c6b5d87807c1b5c456771aaa94", "pairLabel": "USDC/WETH", "exchangeAddress": "0x1080ee857d165186af7f8d63e8ec510c28a6d1ea", "exchangeName": "Uniswap", "exchangeLogo": "https://logo.moralis.io/0xe708_0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f_769a0b766bd3d6d1830f0a95d7b3e313", "baseToken": "ETH", "quoteToken": "USDT", "bought": "", "sold": "", "baseQuotePrice": "0.01", "totalValueUsd": 1230 }}