sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
  1. REST API
  2. Orders

Get All Trades

PreviousGet All Done OrdersNextRequest for Quote (RFQ)

Last updated 1 year ago

GET https://api.sfox.com/v1/account/trades

Retrieve a list of completed trades (fills).

Path Parameters

Parameter
Type
Description

page_size

number

The maximum number of trades to include in the response.

e.g. page_size=20 will return a maximum of 20 trades in the response

Default page_size = 100

last_seen_id

number

The cursor of trade to paginate from. The response will contain trades completed after the cursor.

e.g. last_seen_id=NjM1MjQ20c= will return trades completed after the trade associated with this cursor

Responses

200
{
    "data": [
        {
            "cursor": "NjM1MzUwNzY=",
            "trade_id": 829106821,
            "order_id": 758399024,
            "date_updated": "2024-02-22T01:08:18.000Z",
            "action": "Sell",
            "currency_pair": "btcusd",
            "quantity": "0.01000000",
            "amount": "515.83628237",
            "price": "51583.62823740",
            "fees": "0.00000000",
            "net_amount": "515.83628237"
        },
        {
            "cursor": "NjM1MzUwNzQ=",
            "trade_id": 829106818,
            "order_id": 758319036,
            "date_updated": "2024-02-22T01:08:18.000Z",
            "action": "Buy",
            "currency_pair": "btcusd",
            "quantity": "0.01000000",
            "amount": "515.24440000",
            "price": "51524.44000000",
            "fees": "0.00000000",
            "net_amount": "515.24440000"
        },
        {
            "cursor": "NjM1MzUwNzI=",
            "trade_id": 829106817,
            "order_id": 758399024,
            "date_updated": "2024-02-22T01:08:18.000Z",
            "action": "Sell",
            "currency_pair": "btcusd",
            "quantity": "0.01000000",
            "amount": "515.79383311",
            "price": "51579.38331110",
            "fees": "0.00000000",
            "net_amount": "515.79383311"
        },
        {
            "cursor": "NjM1MzUwNjc=",
            "trade_id": 829105211,
            "order_id": 758399602,
            "date_updated": "2024-02-22T01:05:44.000Z",
            "action": "Sell",
            "currency_pair": "ltcusd",
            "quantity": "7.91515120",
            "amount": "542.39983445",
            "price": "68.52678120",
            "fees": "0.00000000",
            "net_amount": "542.39983445"
        },
        {
            "cursor": "NjM1MzUwNjU=",
            "trade_id": 829105212,
            "order_id": 758399603,
            "date_updated": "2024-02-22T01:05:44.000Z",
            "action": "Buy",
            "currency_pair": "ltcusd",
            "quantity": "7.91515120",
            "amount": "542.41023812",
            "price": "68.52809560",
            "fees": "0.00000000",
            "net_amount": "542.41023812"
        }
    ]
}

Example Requests

curl -H 'Authorization: Bearer <API_TOKEN>' \
  'https://api.sfox.com/v1/account/trades?page_size=<PAGE SIZE>&last_seen_id=
<CURSOR>'
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/account/trades?page_size=<PAGE_SIZE>&last_seen_id=
<CURSOR>',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.get(
  "https://api.sfox.com/v1/account/trades?page_size=<PAGE SIZE>&last_seen_id=
<CURSOR>",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
Stream trades real-time using the Trades WebSocket feed.