NAV Navbar
shell

Authentication

To authenticate, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" -H "X-Api-Key: API_KEY"

Make sure to replace API_KEY with your API key.

BitFex.Trade uses API-key for authentication.

BitFex.Trade expects for the API key to be included in all private API requests to the server in a header that looks like the following:

X-Api-Key: API_KEY

You can get the API-key by link https://bitfex.trade/en/pages/profile in section Trade API Keys

User Info

Get Information About Current User

curl https://bitfex.trade/api/v1/user -H "X-Api-Key: API_KEY" \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "username": "BitFex",
  "mfaActivated": true,
  "id": "x123",
  "fee": 0.0015,
  "fee_maker": 0.0015,
  "fee_taker": 0.0015,
  "balances": {
    "BTC": 0.0,
    "RUR": 10.5,
    // ...
    "DOGE": 0.0
  },
  "total": 10.5,
  "balances_in_orders": {
    "BTC": 0.0,
    "RUR": 0.0,
    // ...
    "DOGE": 100.1
  },
  "chartSettings": []
}

This endpoint return all information about current user.

HTTP Request

GET https://bitfex.trade/api/v1/user

Orders

My Orders

curl https://bitfex.trade/api/v1/orders/my -H "X-Api-Key: API_KEY" \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "orders": [
    {
      "id": 1,
      "pair": "BTC_RUR",
      "amount": 26931,
      "price": 1e-08,
      "operation": "buy",
      "completed": false,
      "updated": 1564967319000,
      "user_id": "x123"
    },
    {
      "id": 2,
      "pair": "KWH_ETH",
      "amount": 1000000,
      "price": 1.2e-07,
      "operation": "sell",
      "completed": false,
      "updated": 1563824693000,
      "user_id": "x123"
    }
}

Active orders for current user

HTTP Request

GET https://bitfex.trade/api/v1/orders/my

My Completed Orders

curl https://bitfex.trade/api/v1/orders/completed?page=0&pair=BTC_RUR -H "X-Api-Key: API_KEY" \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "total": 123,
  "history": [
    {
      "id": 1,
      "kind": "sell",
      "amount": 10.5,
      "price":0.00000001,
      "currency_base":"STEEP",
      "currency_target":"BTC",
      "status":"completed",
      "completed_at":"2019-01-01T12:00:00Z"
    },
    {
      "id": 2,
      "kind": "buy",
      "amount": 0.00012,
      "price": 300000.0,
      "currency_base": "BTC",
      "currency_target": "RUR",
      "status": "completed",
      "completed_at": "2019-01-01T12:00:00Z"
    }
  ]
}

Completed orders for current user

HTTP Request

GET https://bitfex.trade/api/v1/orders/completed

URL Parameters

Parameter Description
page page number (required)
pair filter by pair (optional, skip if filter not required)

Orders List

curl "https://bitfex.trade/api/v2/orders?pair=BTC_RUR" \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "orders": [
    {
      "id": 1,
      "pair": "BTC_RUR",
      "amount": 6.528e-05,
      "price": 686576.89,
      "operation": "sell",
      "completed": false,
      "updated": 1565113275000,
      "user_id": "x123"
    },
    {
      "id": 2,
      "pair": "BTC_RUR",
      "amount": 6.102e-05,
      "price": 692599.5,
      "operation": "buy",
      "completed": false,
      "updated": 1565113274000,
      "user_id": "x123"
    }
  ]
}

Last 20 completed orders and all orders in progress.

HTTP Request

GET https://bitfex.trade/api/v2/orders

URL Parameters

Parameter Description
pair pair name (required)

Create Order

curl https://bitfex.trade/api/v1/orders \
  -X POST \
  -d '{ "order": { "pair": "BTC_RUR", "operation": "buy", "amount": 1.00000000, "price": 350000.00 } }' \
  -H "Content-Type: application/json"

Success (order fully completed)

{
  "success": true
}

Success (order not fully completed)

{
  "success": true,
  "order_id": 1
}

Creates new order.

HTTP Request

POST https://bitfex.trade/api/v1/orders

Required JSON Body Parameters

Parameter Description
order[pair] pair name
order[operation] operation kind (one of: buy, sell)
order[amount] order amount
order[price] order price

Cancel Order

curl https://bitfex.trade/api/v1/orders \
  -X DELETE \
  -H "Content-Type: application/json"

Success

{
  "success": true
}

Deletes current user's order.

HTTP Request

DELETE https://bitfex.trade/api/v1/orders/:id

URL Parameters

Parameter Description
id order id (required)

Orders List History for Pair

curl https://bitfex.trade/api/v1/orders/BTC_RUR/history \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "history": [
    {
      "id": 1,
      "date": 1565113878000,
      "kind": "buy",
      "price": 710710,
      "amount": 1.721e-05,
      "total": 12.23
    },
    {
      "id": 2,
      "date": 1565113749000,
      "kind": "sell",
      "price": 710710,
      "amount": 1.976e-05,
      "total": 14.04
    }
}

Last 20 completed orders and all orders in progress.

HTTP Request

GET https://bitfex.trade/api/v1/orders/:pair/history

URL Parameters

Parameter Description
pair pair name (required)

Volumes

curl https://bitfex.trade/api/v1/volume \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "prices": {
    "BTC_RUR": 713678.61,
    // ...
    "LTC_RUR": 5949.73
  },
  "volumes": {
    "BTC_RUR": 0.02004869,
    // ...
    "ACM_BTC": 8107.838019
  },
  "volumes_rur": {
    "BTC_RUR": 14308.3212115209,
    // ...
    "ACM_BTC": 17185.57998549007
  },
  "price_changes": {
    "BTC_RUR": 0.55,
    // ...
    "ACM_BTC": -31.88
  }
}

Trading current prices, volumes, volumes in RUR and price changes for last 24 hours.

HTTP Request

GET https://bitfex.trade/api/v1/volume

Charts Data

curl https://bitfex.trade/api/v1/charts/BTC_RUR \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "stats": {
    "low": 710062.19,
    "high": 729819.75,
    "volume": 0.01363779,
    "last": 716689.92,
    "buy": 710000,
    "sell": 722712.52
  }
}

Trading current prices, volumes, volumes in RUR and price changes for last 24 hours.

HTTP Request

GET https://bitfex.trade/api/v1/charts/:pair

URL Parameters

Parameter Description
pair pair name (required)

Ticker Data

curl https://bitfex.trade/api/v1/ticker \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

 {
  "BTC_RUR": {
    "vol": 0.02000844,
    "high": 730000,
    "low": 710062.19,
    "open": 715866.67,
    "close": 719401.52,
    "last": 716689.92,
    "sell": 722712.52,
    "buy": 710667.31,
    "status": "trading"
  },
  // ...
  "LTC_RUR": {
    "vol": 2.15869447,
    "high": 6717.03,
    "low": 5833.24,
    "open": 6179.14,
    "close": 6414.69,
    "last": 5995.26,
    "sell": 15999.99,
    "buy": 5995.26,
    "status": "trading"
  }
}

Returns statistical and listing information for all pairs.

HTTP Request

GET https://bitfex.trade/api/v1/ticker

Live Trading Data

curl https://bitfex.trade/api/3/depth/BTC_RUR \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "BTC_RUR": {
    "asks": [
      [722712.52, 1.81e-05],
      // ...
      [10000000000, 2e-05]
    ],
    "bids": [
      [713678.61, 5.564e-05],
      // ...
      [710000, 0.00119155]
    ]
  }
}

Asks and Bids for pair

HTTP Request

GET https://bitfex.trade/api/3/depth/:pair

URL Parameters

Parameter Description
pair pair name (required)

General Information

curl https://bitfex.trade/api/v1/info \
  -H "Content-Type: application/json"

The above command returns JSON structured like this:

{
  "success": true,
  "currencies": {
    "BTC": {
      "full_name": "Bitcoin",
      "website": "https://bitcoin.org",
      "address_info": "https://www.blockchain.com/btc/address/:address",
      "tx_info": "https://www.blockchain.com/btc/tx/:txid",
      "confirmations": 6,
      "deposit_fee": "0%",
      "withdrawal_fee": 0.001,
      "minimal_withdrawal": 0.002,
      "enabled": true,
      "can_withdraw": true,
      "can_deposit": true
    },
    "BCH": {
      "address_info": "https://blockchair.com/bitcoin-cash/address/:address",
      "tx_info": "https://blockchair.com/bitcoin-cash/transaction/:txid",
      "deposit_fee": "0%",
      "confirmations": 6
    },
    // ...
    "DASH": {
      "full_name": "Dash",
      "website": "https://dash.org/",
      "address_info": "https://explorer.dash.org/address/:address",
      "tx_info": "https://explorer.dash.org/tx/:txid",
      "confirmations": 6,
      "deposit_fee": "0%",
      "withdrawal_fee": 0.001,
      "minimal_withdrawal": 0.002,
      "enabled": true,
      "can_withdraw": true,
      "can_deposit": true
    }
  }
}

Return general Exchange information about currencies

HTTP Request

GET https://bitfex.trade/api/v1/info