API ReferenceToken APIGet Token SwapsGet Swaps by Pair AddressGet Swaps by Pair Address Mainnet OnlyLooking for swaps by pair address on EVM?Access token swap data by pair address using our EVM API.Explore EVM APIGEThttps://solana-gateway.moralis.io/token/:network/pairs/:pairAddress/swapsGet all swap related transactions (buy, sell, add liquidity & remove liquidity) for a specific pair address.NoteSwaps data is synced and available only from September 2024 onwards. Data prior to this date is not included.PATH PARAMSnetworkstringrequiredThe network to querypairAddressstringrequiredThe address of the pair to queryQUERY PARAMSlimitnumberThe limit per pagecursorstringThe cursor to the next pageorderstringThe order of itemsfromDatestringThe starting date (format in seconds or datestring accepted by momentjs)toDatestringThe ending date (format in seconds or datestring accepted by momentjs)transactionTypesstringTransaction types to fetch. Possible values: 'buy', 'sell', 'addLiquidity' or 'removeLiquidity' separated by commaResponses200400Bad Request404Not Found429Too Many Requests500Internal Server ErrorAPI KEYTest Live APIcURLNode.jsPythonGoPHPcurl --request GET \ --url 'https://solana-gateway.moralis.io/token/mainnet/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell%2CaddLiquidity%2CremoveLiquidity' \ --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/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell%2CaddLiquidity%2CremoveLiquidity', 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/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell%2CaddLiquidity%2CremoveLiquidity"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/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell%2CaddLiquidity%2CremoveLiquidity" 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/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/swaps?limit=25&order=DESC&transactionTypes=buy%2Csell%2CaddLiquidity%2CremoveLiquidity', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 { "page": 1, "pageSize": 100, "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...kJ8E_653QrA4Q8zb_9OCn6opE9aBo8PjqLeQU_VCaaw", "exchangeName": "Raydium AMM v4", "exchangeLogo": "https://entities-logos.s3.amazonaws.com/raydium.png", "exchangeAddress": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8", "pairLabel": "BREAD/SOL", "pairAddress": "ALeyWh7zN979ZHUWY6YTMJC8wWowzdYqi8RRPRyB3LAd", "result": { "transactionHash": "3o9NfCBWaDEb8JLJGdp8tfWwXURNokanCvUJf9A9f5nFqmZkRvWcfhkek4t47UhRDSGKHsSzi8MBusin8H7x7YYD", "transactionType": "sell", "transactionIndex": 250, "subCategory": "sellAll", "blockTimestamp": "2024-11-28T09:44:55.000Z", "blockNumber": 304108120, "walletAddress": "A8GVZWGMxRAouFQymPoMKx527JhHKrBRuqFx7NET4j22", "baseTokenAmount": "199255.444466200", "quoteTokenAmount": "0.007374998", "baseTokenPriceUsd": 0.000008794, "quoteTokenPriceUsd": 237.60336565, "baseQuotePrice": "0.0000000370127", "totalValueUsd": 1.752324346 }}