bitcain docs
API Reference

Exchange

Exchange connectivity - validate credentials, list supported exchanges

Get Bnb Burn

GET
/api/exchange/bnb-burn

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange?string
Default"binanceus"

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/bnb-burn"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Set Bnb Burn

POST
/api/exchange/bnb-burn

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

spot_bnb_burn*boolean

True to pay spot trading fees with BNB (the fee discount).

exchange?string

Binance venue: 'binanceus' or 'binance'.

Default"binanceus"

Response Body

application/json

application/json

curl -X POST "https://loading/api/exchange/bnb-burn" \  -H "Content-Type: application/json" \  -d '{    "spot_bnb_burn": true  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Dustable Assets

GET
/api/exchange/dust-assets

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange?string
Default"binanceus"

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/dust-assets"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Validate Exchange

POST
/api/exchange/validate

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

exchange*string

Exchange name (binance, coinbase, kraken, etc.)

api_key*string

Exchange API key

api_secret*string

Exchange API secret

api_passphrase?|

Exchange API passphrase (if required)

Response Body

application/json

application/json

curl -X POST "https://loading/api/exchange/validate" \  -H "Content-Type: application/json" \  -d '{    "exchange": "string",    "api_key": "string",    "api_secret": "string"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Markets

GET
/api/exchange/markets

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/markets?exchange=string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Ticker

GET
/api/exchange/ticker

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string
symbol*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/ticker?exchange=string&symbol=string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Supported Exchanges

GET
/api/exchange/supported

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/exchange/supported"
{}

Get Trade Route

GET
/api/exchange/route

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

base*string

Base asset (e.g. BTC)

Length1 <= length
quote*string

Quote asset (e.g. USDT)

Length1 <= length
size?|

Optional base-asset size — drops routes whose min_amount exceeds it.

quote_size?|

Optional quote-currency notional — drops routes whose min_cost exceeds it.

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/route?base=string&quote=string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Exchange Info

GET
/api/exchange/{exchange_name}/info

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

exchange_name*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/string/info"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List Credentials

GET
/api/exchange/credentials

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange_name?|

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/credentials"
{
  "credentials": [
    {
      "id": "string",
      "user_id": "string",
      "exchange_name": "string",
      "credential_name": "string",
      "permissions": [
        "string"
      ],
      "ip_whitelist": [
        "string"
      ],
      "exchange_metadata": {},
      "is_active": true,
      "last_used": "2019-08-24T14:15:22Z",
      "last_validation": "2019-08-24T14:15:22Z",
      "validation_status": "string",
      "validation_error": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total_count": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Store Credentials

POST
/api/exchange/credentials

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

exchange_name*string

Exchange name (binance, binanceus, binance_us, coinbase, kraken, bybit, kucoin, bitfinex, okx, gate_io)

credential_name?string

User-friendly name for this credential set

Default"Default"
Length1 <= length <= 100
api_key*string

Exchange API key (will be encrypted)

Length8 <= length
api_secret*string

Exchange API secret (will be encrypted)

Length8 <= length
api_passphrase?|

Exchange API passphrase (optional, required for some exchanges)

permissions?array<>

List of permissions: read, trade, withdraw

ip_whitelist?array<>

List of whitelisted IP addresses/CIDR ranges (e.g., ['1.2.3.4', '10.0.0.0/24'])

exchange_metadata?

Exchange-specific configuration (e.g., {'testnet': true, 'use_us': true})

Response Body

application/json

application/json

curl -X POST "https://loading/api/exchange/credentials" \  -H "Content-Type: application/json" \  -d '{    "exchange_name": "string",    "api_key": "stringst",    "api_secret": "stringst"  }'
{
  "id": "string",
  "user_id": "string",
  "exchange_name": "string",
  "credential_name": "string",
  "permissions": [
    "string"
  ],
  "ip_whitelist": [
    "string"
  ],
  "exchange_metadata": {},
  "is_active": true,
  "last_used": "2019-08-24T14:15:22Z",
  "last_validation": "2019-08-24T14:15:22Z",
  "validation_status": "string",
  "validation_error": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Credential

GET
/api/exchange/credentials/{credential_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

credential_id*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/credentials/string"
{
  "id": "string",
  "user_id": "string",
  "exchange_name": "string",
  "credential_name": "string",
  "api_key_masked": "string",
  "has_passphrase": true,
  "permissions": [
    "string"
  ],
  "ip_whitelist": [
    "string"
  ],
  "exchange_metadata": {},
  "is_active": true,
  "last_used": "2019-08-24T14:15:22Z",
  "last_validation": "2019-08-24T14:15:22Z",
  "validation_status": "string",
  "validation_error": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete Credential

DELETE
/api/exchange/credentials/{credential_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

credential_id*string

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/exchange/credentials/string"
{
  "success": true,
  "message": "string",
  "deleted_id": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update Credential

PUT
/api/exchange/credentials/{credential_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

credential_id*string

Request Body

application/json

credential_name?|

User-friendly name for this credential set

api_key?|

Exchange API key (will be encrypted)

api_secret?|

Exchange API secret (will be encrypted)

api_passphrase?|

Exchange API passphrase (optional)

permissions?array<>|

List of permissions: read, trade, withdraw

ip_whitelist?array<>|

List of whitelisted IP addresses/CIDR ranges

exchange_metadata?|

Exchange-specific configuration

is_active?|

Whether the credential is active

Response Body

application/json

application/json

curl -X PUT "https://loading/api/exchange/credentials/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "user_id": "string",
  "exchange_name": "string",
  "credential_name": "string",
  "permissions": [
    "string"
  ],
  "ip_whitelist": [
    "string"
  ],
  "exchange_metadata": {},
  "is_active": true,
  "last_used": "2019-08-24T14:15:22Z",
  "last_validation": "2019-08-24T14:15:22Z",
  "validation_status": "string",
  "validation_error": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Balance

GET
/api/exchange/balance

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string
currency?|
credential_id?|

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/balance?exchange=string"
{
  "balances": {
    "property1": {
      "currency": "string",
      "free": 0,
      "locked": 0,
      "total": 0,
      "sync_timestamp": "2019-08-24T14:15:22Z"
    },
    "property2": {
      "currency": "string",
      "free": 0,
      "locked": 0,
      "total": 0,
      "sync_timestamp": "2019-08-24T14:15:22Z"
    }
  },
  "exchange": "string",
  "currency": "string",
  "last_sync": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Sync Balance

POST
/api/exchange/balance/sync

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string
credential_id?|

Response Body

application/json

application/json

curl -X POST "https://loading/api/exchange/balance/sync?exchange=string"
{
  "success": true,
  "user_id": "string",
  "exchange": "string",
  "currencies_synced": 0,
  "balances": {
    "property1": {
      "property1": 0,
      "property2": 0
    },
    "property2": {
      "property1": 0,
      "property2": 0
    }
  },
  "timestamp": "2019-08-24T14:15:22Z",
  "error": "string",
  "error_type": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Balance History

GET
/api/exchange/balance/history

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string
currency*string
start_date?|
end_date?|
limit?integer
Default100

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/balance/history?exchange=string&currency=string"
{
  "history": [
    {
      "currency": "string",
      "free": 0,
      "locked": 0,
      "total": 0,
      "sync_timestamp": "2019-08-24T14:15:22Z",
      "sync_status": "string"
    }
  ],
  "exchange": "string",
  "currency": "string",
  "total_records": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Trades

GET
/api/exchange/trades

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string
symbol?|
start_date?|
end_date?|
limit?integer
Default100
offset?integer
Default0

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/trades?exchange=string"
{
  "trades": [
    {
      "id": "string",
      "exchange_trade_id": "string",
      "exchange": "string",
      "symbol": "string",
      "side": "string",
      "price": 0,
      "amount": 0,
      "total": 0,
      "fee": 0,
      "fee_currency": "string",
      "trade_timestamp": "2019-08-24T14:15:22Z",
      "sync_status": "string",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "exchange": "string",
  "symbol": "string",
  "total_records": 0,
  "has_more": false
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Sync Trades

POST
/api/exchange/trades/sync

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange*string
credential_id?|
symbol?|
since?|
limit?integer
Default100

Response Body

application/json

application/json

curl -X POST "https://loading/api/exchange/trades/sync?exchange=string"
{
  "success": true,
  "user_id": "string",
  "exchange": "string",
  "symbol": "string",
  "trades_synced": 0,
  "trades_duplicate": 0,
  "timestamp": "2019-08-24T14:15:22Z",
  "error": "string",
  "error_type": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Trade Stats

GET
/api/exchange/trades/stats

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

exchange?|
start_date?|
end_date?|

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/trades/stats"
{
  "total_trades": 0,
  "buy_count": 0,
  "sell_count": 0,
  "total_volume": 0,
  "total_fees": 0,
  "synced_count": 0,
  "failed_count": 0,
  "first_trade": "2019-08-24T14:15:22Z",
  "last_trade": "2019-08-24T14:15:22Z",
  "exchange": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get All Exchange Health

GET
/api/exchange/health

Query Parameters

force_refresh?boolean
Defaultfalse

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/health"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Single Exchange Health

GET
/api/exchange/{exchange_name}/health

Path Parameters

exchange_name*string

Query Parameters

force_refresh?boolean
Defaultfalse

Response Body

application/json

application/json

curl -X GET "https://loading/api/exchange/string/health"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}