Skip to main content
GET
/
getTransactions
Get Transactions
curl --request GET \
  --url https://api-v2.swaps.xyz/api/getTransactions \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api-v2.swaps.xyz/api/getTransactions"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api-v2.swaps.xyz/api/getTransactions', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-v2.swaps.xyz/api/getTransactions",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-v2.swaps.xyz/api/getTransactions"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api-v2.swaps.xyz/api/getTransactions")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api-v2.swaps.xyz/api/getTransactions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "txs": [
    {
      "status": "success",
      "sender": "0x1234567890123456789012345678901234567890",
      "srcChainId": 1,
      "bridgeDetails": {
        "isBridge": true,
        "bridgeTime": 420,
        "txPath": [
          {
            "chainId": 1,
            "txHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
            "timestamp": 1640995200,
            "nextBridge": "layerZero"
          }
        ]
      },
      "txId": "0x49b1d3d38176e45864fd55500c6c1879ab318609e1ed0c8eb9abd818e6c811fd",
      "dstChainId": 42161,
      "srcTxHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
      "dstTxHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
      "actionRequest": {
        "sender": "<string>",
        "srcChainId": 123,
        "srcToken": "<string>",
        "dstChainId": 123,
        "dstToken": "<string>",
        "slippage": 5000,
        "amount": "<string>",
        "recipient": "<string>",
        "to": "<string>",
        "data": "<string>",
        "value": "<string>",
        "erc20Amount": "<string>",
        "erc20Spender": "<string>",
        "bridgeIds": [
          "<string>"
        ],
        "refundTo": "<string>",
        "appFees": [
          {
            "bps": 123,
            "receiverAddress": "<string>"
          }
        ]
      },
      "actionResponse": {
        "tx": {
          "to": "<string>",
          "data": "<string>",
          "value": "<string>",
          "chainId": 123
        },
        "txId": "<string>",
        "amountIn": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "amountInMax": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "amountOut": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "amountOutMin": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "protocolFee": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "applicationFee": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "exchangeRate": 123,
        "estimatedTxTime": 123,
        "estimatedPriceImpact": 123,
        "requiresTokenApproval": true,
        "requiresRegisterTransaction": true,
        "allRoutes": [
          {
            "tx": {
              "to": "<string>",
              "data": "<string>",
              "value": "<string>",
              "chainId": 123
            },
            "txId": "<string>",
            "amountIn": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "amountInMax": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "amountOut": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "amountOutMin": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "protocolFee": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "applicationFee": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "exchangeRate": 123,
            "estimatedTxTime": 123,
            "estimatedPriceImpact": 123,
            "requiresRegisterTransaction": true,
            "bridgeFee": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            },
            "bridgeIds": [
              "<string>"
            ],
            "bridgeRoute": [
              {
                "srcChainId": 123,
                "dstChainId": 123,
                "srcBridgeToken": "<string>",
                "dstBridgeToken": "<string>",
                "bridgeId": "<string>"
              }
            ],
            "executions": [
              {
                "txType": "evmTransactionSign",
                "data": "<string>",
                "signature": "<string>"
              }
            ],
            "relayerFee": {
              "chainId": 123,
              "address": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "decimals": 123,
              "isNative": true,
              "amount": "<string>",
              "logo": "<string>",
              "swapsXyzCode": "<string>",
              "usdAmount": 123
            }
          }
        ],
        "bridgeFee": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        },
        "bridgeIds": [
          "<string>"
        ],
        "bridgeRoute": [
          {
            "srcChainId": 123,
            "dstChainId": 123,
            "srcBridgeToken": "<string>",
            "dstBridgeToken": "<string>",
            "bridgeId": "<string>"
          }
        ],
        "executions": [
          {
            "txType": "evmTransactionSign",
            "data": "<string>",
            "signature": "<string>"
          }
        ],
        "relayerFee": {
          "chainId": 123,
          "address": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "decimals": 123,
          "isNative": true,
          "amount": "<string>",
          "logo": "<string>",
          "swapsXyzCode": "<string>",
          "usdAmount": 123
        }
      },
      "usdRates": {
        "timestamp": 123,
        "srcToken": 123,
        "dstToken": 123
      },
      "workflow": {
        "name": "polymarket",
        "operation": "placeOrder",
        "status": "success",
        "timestamp": 1763996274,
        "data": {
          "userId": "0x0797bfec6d2d4f733d461bbee8125805e9e9c892",
          "orderRequest": {
            "tokenID": "110902308091723190012269532299497167125504426554890434343419495764557291673806",
            "feeRateBps": 0,
            "slippage": 100,
            "negRisk": true,
            "amount": 5,
            "price": 0.021,
            "size": 5
          },
          "orderResponse": {
            "id": "0xbd2f3c625c1f6f918a74e8645c3afee9e8f2c5adf91f178efa5e1b65f74fb489",
            "status": "MATCHED",
            "owner": "258f7485-b93f-52e5-2327-a53c49a299c1",
            "maker_address": "0xBEDcAD563ddf52391573a016Bc5EC7A334Eec756",
            "market": "0xb050c89e1e5738c79e117d28da1f057ac2f193511aab87a01b517b466c7265dc",
            "asset_id": "110902308091723190012269532299497167125504426554890434343419495764557291673806",
            "original_size": "5",
            "size_matched": "0",
            "price": "0.02",
            "outcome": "No",
            "expiration": "1763996360",
            "order_type": "GTD",
            "associate_trades": [
              "<string>"
            ],
            "created_at": 1763996291
          },
          "relayTx": {
            "txHash": "<string>",
            "status": "<string>"
          }
        }
      },
      "org": {
        "appId": "0xb38801d6",
        "appName": "Box Examples / Scenarios",
        "affiliateId": "0x00000000"
      },
      "usdValue": 100.5,
      "srcTx": {
        "txHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
        "chainId": 1,
        "timestamp": 1765593607,
        "toAddress": "0x38630c8ec92494cf96ded12060d8136b75e7a8b5",
        "value": "0",
        "paymentToken": {
          "name": "Ethereum",
          "symbol": "ETH",
          "decimals": 18,
          "amount": "1000000000000000000",
          "chainId": 137,
          "address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
          "isNative": false,
          "usdAmount": 4.00687776
        },
        "revertReason": "<string>"
      },
      "dstTx": {
        "txHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
        "chainId": 1,
        "timestamp": 1765593607,
        "toAddress": "0x38630c8ec92494cf96ded12060d8136b75e7a8b5",
        "value": "0",
        "paymentToken": {
          "name": "Ethereum",
          "symbol": "ETH",
          "decimals": 18,
          "amount": "1000000000000000000",
          "chainId": 137,
          "address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
          "isNative": false,
          "usdAmount": 4.00687776
        },
        "revertReason": "<string>"
      }
    }
  ],
  "cursor": {
    "next": "NjgxNGU5YzQ1ZTJjNjYwMDAxMjM0NTY3XzE3MDY3NDU2MDA="
  }
}

Authorizations

x-api-key
string
header
required

Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.

Query Parameters

appIds
string

Comma-separated list of your app IDs. By default, a request to this endpoint will return transactions across all appIds in your org. Each API key has a unique app ID. Multiple app IDs can exist within a single org ID.

Example:

"0x5344e5a7,0x5314e6a7"

walletAddress
string

Wallet address to filter transactions by user

Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

chainIds
string

Comma-separated list of chain IDs to filter by

Example:

"1,42161,10"

limit
integer
default:25

Number of results per page (max 50)

Required range: 1 <= x <= 50
Example:

25

period
enum<string>

Time period filter

Available options:
day,
week,
month
Example:

"week"

startDate
string

Start date filter (Unix timestamp)

Example:

"1640995200"

endDate
string

End date filter (Unix timestamp)

Example:

"1672531200"

cursor
string

Pagination cursor from previous response. Use the cursor.next value from the response to fetch the next page.

Example:

"NjgxNGU5YzQ1ZTJjNjYwMDAxMjM0NTY3XzE3MDY3NDU2MDA="

Response

200 - application/json

Transaction history response

txs
object[]
cursor
object