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 Done Orders

PreviousGet All Open OrdersNextGet All Trades

Last updated 10 months ago

GET https://api.sfox.com/v1/orders/done

Retrieve a list of completed orders.

: 5 requests per 10 seconds

sFOX recommends using the instead, which streams order updates in real-time and does not count towards your request limit.

Query Parameters

Parameter
Type
Description

limit

int

Limit on the number of results to return. Default and maximum = 50. Each response will include no more than 50 results.

before

int

Pagination parameter. Return results that occurred before (older) than the specified ID (id from response body).

after

int

Pagination parameter. Return results that occurred after (newer) than the specified ID (id from response body).

action

string

Filter response to only include orders with the specified action/side. Possible values: buy or sell (case sensitive).

currency_pair

string

Filter response to only include orders on the specified currency pair (pair from response body). Format: <basequote> e.g. btcusd.

algorithm_id

int

status

string

Responses

200
[
    {
        "id": 701968334,
        "side_id": 500,
        "action": "Buy",
        "algorithm_id": 200,
        "algorithm": "Smart",
        "type": "Smart",
        "pair": "btcusd",
        "quantity": 0.001,
        "price": 16900.6,
        "amount": 0,
        "net_market_amount": 0,
        "filled": 0.001,
        "vwap": 16900.6,
        "filled_amount": 16.9006,
        "fees": 0.0338012,
        "net_proceeds": -16.8667988,
        "status": "Done",
        "status_code": 300,
        "routing_option": "BestPrice",
        "routing_type": "NetPrice",
        "time_in_force": "GTC",
        "expires": null,
        "dateupdated": "2022-11-18T01:26:40.000Z",
        "date_added": "2022-11-17T20:52:40.000Z",
        "client_order_id": "94b0e7c4-0fa7-403d-a0d0-6c4ccec76630",
        "user_tx_id": "94b0e7c4-0fa7-403d-a0d0-6c4ccec76630",
        "o_action": "Buy",
        "algo_id": 200,
        "algorithm_options": null,
        "destination": ""
    },
    {
        "id": 701945645,
        "side_id": 500,
        "action": "Buy",
        "algorithm_id": 201,
        "algorithm": "Limit",
        "type": "Limit",
        "pair": "btcusd",
        "quantity": 0.01,
        "price": 16905,
        "amount": 0,
        "net_market_amount": 0,
        "filled": 0.01,
        "vwap": 16643,
        "filled_amount": 166.43,
        "fees": 0.16643,
        "net_proceeds": -166.26357,
        "status": "Done",
        "status_code": 300,
        "routing_option": "BestPrice",
        "routing_type": "NetPrice",
        "time_in_force": "GTC",
        "expires": null,
        "dateupdated": "2022-11-17T19:39:18.000Z",
        "date_added": "2022-11-17T18:52:40.000Z",
        "client_order_id": "",
        "user_tx_id": "",
        "o_action": "Buy",
        "algo_id": 201,
        "algorithm_options": null,
        "destination": ""
   }
]

Example Requests

curl -H 'Authorization: Bearer <API_TOKEN>' \
  'https://api.sfox.com/v1/orders/done?limit=20&after=711876817&currency_pair=btcusd'
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/orders/done?limit=20&after=711876817&currency_pair=btcusd',
  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/orders/done?limit=20&after=711876817&currency_pair=btcusd",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)

Filter response to only include orders with the specified algorithm_id/order type. Possible values: .

Filter response to only include orders with the specified order status (status from response body). Possible values: .

Rate Limit
Orders WebSocket feed
Order Types
Order Statuses