Skip to main content

Fetch Transactions

POST /api/v1/transactions Fetch transactions from any supported exchange in unified format. Requires session authentication.

Request Format (Using Internal Credentials)

curl -X POST "https://data.quantcite.com/api/v1/transactions" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer your_session_token" \
     -d '{
       "exchange": "bybit",
       "testnet": false,
       "start_time": 1693526400000,
       "end_time": 1696204800000,
       "transaction_types": ["deposits", "withdrawals", "trades"],
       "limit": 100
     }'

Request Format (Using Your Own API Credentials)

curl -X POST "https://data.quantcite.com/api/v1/transactions" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer your_session_token" \
     -d '{
       "exchange": "bybit",
       "testnet": false,
       "start_time": 1693526400000,
       "end_time": 1696204800000,
       "transaction_types": ["deposits", "withdrawals", "trades"],
       "limit": 100,
       "credentials": {
         "api_key": "YOUR_BYBIT_API_KEY",
         "secret": "YOUR_BYBIT_SECRET"
       }
     }'

Request Parameters

ParameterTypeRequiredDescription
exchangestringYesExchange name (e.g., “bybit”)
testnetbooleanNoUse testnet environment (default: false)
start_timenumberNoStart time in Unix milliseconds
end_timenumberNoEnd time in Unix milliseconds
transaction_typesarrayNoArray of transaction types to fetch
limitnumberNoMaximum number of transactions to return
credentialsobjectNoYour exchange API credentials (if not using internal credentials)

Credentials Object (Optional)

ParameterTypeRequiredDescription
api_keystringYes*Your exchange API key
secretstringYes*Your exchange API secret
passphrasestringNoRequired for OKX, Coinbase, Kraken
*Required when using your own credentials instead of internal credentials

Supported Transaction Types

TypeDescription
depositsDeposit transactions (incoming funds)
withdrawalsWithdrawal transactions (outgoing funds)
tradesSpot trading transactions
spot_ordersSpot market orders
futures_linearLinear futures trading
futures_inverseInverse futures trading
transfersInternal transfers between accounts
holdingsCurrent account balances
ledgerGeneral ledger entries
leverage_token_tradesLeveraged token transactions

Response Format

{
  "success": true,
  "message": "Successfully parsed 9 transactions from 2 transaction types",
  "exchange": "bybit",
  "total_transactions": 9,
  "processing_time": 2.05,
  "transactions": [
    {
      "transactionId": "0x4165ad97c0...",
      "timestamp": 1693526400000,
      "label": "Deposit",
      "receivedCurrency": {
        "currency": "USDT",
        "amount": 1000.0
      },
      "sender": null,
      "fee": null,
      "description": {
        "title": "Bybit Deposit",
        "desc": "USDT deposit to account"
      }
    },
    {
      "transactionId": "0x9b1e795843...",
      "timestamp": 1693612800000,
      "label": "Trade",
      "sentCurrency": {
        "currency": "USDT",
        "amount": 500.0
      },
      "receivedCurrency": {
        "currency": "BTC",
        "amount": 0.019
      },
      "fee": {
        "currency": "USDT",
        "amount": 2.5
      },
      "description": {
        "title": "Bybit Spot Trade",
        "desc": "Buy 0.019 BTC at 26315.79 USDT"
      }
    }
  ],
  "summary": {
    "total_count": 9,
    "by_type": {
      "deposit": 8,
      "withdrawal": 1
    },
    "date_range": {
      "start": 1693526400000,
      "end": 1696204800000
    }
  },
  "filters_applied": {
    "start_time": null,
    "end_time": null,
    "transaction_types": ["deposits", "withdrawals"],
    "limit": 10
  }
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
messagestringHuman-readable status message
exchangestringExchange that was queried
total_transactionsnumberTotal number of transactions returned
processing_timenumberTime taken to process the request (seconds)
transactionsarrayArray of transaction objects
summaryobjectSummary statistics
filters_appliedobjectApplied filters for the request

Transaction Data Formats

Deposit Transaction

{
  transactionId: string;
  timestamp: number;
  label: "Deposit" | "Airdrop" | "Staking Reward";
  receivedCurrency: {
    currency: string;
    amount: number;
  };
  sender?: {
    name?: string;
    public_name?: string;
    walletId?: string;
  };
  fee?: {
    currency: string;
    amount: number;
  };
  description: {
    title: string;
    desc: string;
  };
}

Trade Transaction

{
  transactionId: string;
  timestamp: number;
  label: "Trade" | "Swap" | "Buy" | "Sell";
  sentCurrency: {
    currency: string;
    amount: number;
  };
  receivedCurrency: {
    currency: string;
    amount: number;
  };
  fee?: {
    currency: string;
    amount: number;
  };
  description: {
    title: string;
    desc: string;
  };
}

Withdrawal Transaction

{
  transactionId: string;
  timestamp: number;
  label: "Withdrawal";
  sentCurrency: {
    currency: string;
    amount: number;
  };
  fee?: {
    currency: string;
    amount: number;
  };
  description: {
    title: string;
    desc: string;
  };
}

Exchange Credential Requirements

When using your own API credentials, different exchanges have different requirements:

Standard Exchanges (API Key + Secret)

  • Bybit: api_key, secret
  • Binance: api_key, secret
  • KuCoin: api_key, secret
  • Gate.io: api_key, secret
  • Huobi/HTX: api_key, secret
  • Bitfinex: api_key, secret

Exchanges Requiring Passphrase

  • OKX: api_key, secret, passphrase
  • Coinbase: api_key, secret, passphrase
  • Kraken: api_key, secret

Example Credential Objects

Bybit Credentials

{
  "credentials": {
    "api_key": "YOUR_BYBIT_API_KEY",
    "secret": "YOUR_BYBIT_SECRET"
  }
}

OKX Credentials (with passphrase)

{
  "credentials": {
    "api_key": "YOUR_OKX_API_KEY", 
    "secret": "YOUR_OKX_SECRET",
    "passphrase": "YOUR_OKX_PASSPHRASE"
  }
}

Coinbase Credentials (with passphrase)

{
  "credentials": {
    "api_key": "YOUR_COINBASE_API_KEY",
    "secret": "YOUR_COINBASE_SECRET", 
    "passphrase": "YOUR_COINBASE_PASSPHRASE"
  }
}

Security Notes

  • Never share your API credentials with anyone
  • Use read-only API keys when possible for transaction fetching
  • Enable IP whitelisting on your exchange accounts
  • Regularly rotate your API keys for security
  • Store credentials securely and never commit them to version control

Complete Example

Here’s a complete authentication and transaction fetching flow:
import requests
import json

# Step 1: Authenticate
auth_response = requests.post(
    "https://data.quantcite.com/api/v1/authenticate",
    json={"api_key": "demo_key_123"}
)

auth_data = auth_response.json()
session_token = auth_data["session_token"]

print(f"Authenticated as {auth_data['user_tier']} user")

# Step 2: Fetch transactions
headers = {
    "Authorization": f"Bearer {session_token}",
    "Content-Type": "application/json"
}

transactions_response = requests.post(
    "https://data.quantcite.com/api/v1/transactions",
    headers=headers,
    json={
        "exchange": "bybit",
        "testnet": False,
        "transaction_types": ["deposits", "withdrawals"],
        "limit": 10
    }
)

transactions_data = transactions_response.json()

print(f"Retrieved {transactions_data['total_transactions']} transactions")
for tx in transactions_data['transactions']:
    print(f"- {tx['label']}: {tx['description']['title']}")

Error Handling

Common Errors

Status CodeErrorDescription
400invalid_exchangeUnsupported exchange specified
400invalid_transaction_typesInvalid transaction types provided
401session_expiredSession token has expired
401invalid_sessionSession token is invalid
429rate_limit_exceededRate limit exceeded
500exchange_errorError communicating with exchange

Error Response Format

{
  "success": false,
  "error": "invalid_exchange",
  "message": "Exchange 'invalid_exchange' is not supported",
  "supported_exchanges": ["bybit"],
  "timestamp": "2025-09-18T10:30:00.000Z"
}
Always check the success field in responses and handle errors appropriately in your application.