> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whitebit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> WhiteBIT REST API overview — base URL, authentication, quickstart examples, rate limits, and links to all endpoint groups.

Base URL

:

## Base URL

All REST API endpoints are available at:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
https://whitebit.com/api/v4/{endpoint}
```

* **Public endpoints** use the `GET` method and accept parameters as query strings.
* **Private endpoints** use the `POST` method and accept parameters as JSON in the request body.
* All endpoints return time in Unix-time format and respond with JSON.

***

## Quickstart

### Prerequisites

* A WhiteBIT account ([Sign up](https://whitebit.com/auth))
* An API key with appropriate permissions ([API Settings](https://whitebit.com/settings/api))
* A programming language or HTTP client (cURL, Python, JavaScript, or similar)

### Step 1: First public API call

The [Server Status](/api-reference/market-data/server-status) endpoint returns the API life-state. No authentication is required.

**Request:**

**cURL**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X GET "https://whitebit.com/api/v4/public/ping"
```

**Python**

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import requests

response = requests.get("https://whitebit.com/api/v4/public/ping")
print(response.json())
```

**JavaScript**

```javascript theme={"theme":{"light":"github-light","dark":"github-dark"}}
const response = await fetch("https://whitebit.com/api/v4/public/ping");
const data = await response.json();
console.log(data);
```

**Expected response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
["pong"]
```

A response of `["pong"]` confirms the API is operational.

### Step 2: Authentication setup

Private endpoints require HMAC-SHA512 signed requests. See the [Authentication](/api-reference/authentication) guide for the full signing process.

**Required headers for private endpoints:**

| Header | Value |
| - | - |
| `Content-type` | `application/json` |
| `X-TXC-APIKEY` | The public API key |
| `X-TXC-PAYLOAD` | Base64-encoded request body |
| `X-TXC-SIGNATURE` | HMAC-SHA512 signature (hex encoded) |

### Step 3: First authenticated API call

The [Main Balance](/api-reference/account-wallet/main-balance) endpoint retrieves the main account balance. The request body must include `request` (the endpoint path) and `nonce` (unique identifier).

**Request body:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "request": "/api/v4/main-account/balance",
  "nonce": 1594297865000
}
```

**Example with cURL** (replace `YOUR_API_KEY` and `YOUR_SIGNATURE` with the signed payload):

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://whitebit.com/api/v4/main-account/balance" \
  -H "Content-type: application/json" \
  -H "X-TXC-APIKEY: YOUR_API_KEY" \
  -H "X-TXC-PAYLOAD: BASE64_ENCODED_PAYLOAD" \
  -H "X-TXC-SIGNATURE: YOUR_SIGNATURE" \
  -d '{"request":"/api/v4/main-account/balance","nonce":1594297865000}'
```

For a runnable signing implementation in Python, see [First API Call](/guides/first-api-call).

**Expected response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "BTC": { "main_balance": "0" },
  "USDT": { "main_balance": "100.50" }
}
```

The response contains balance data for each asset. Omitted assets have a zero balance.

***

## Rate Limits

For complete rate limits, error codes, and best practices, see [Rate Limits & Error Codes](/api-reference/rate-limits).

## Error Format

All V4 endpoints return errors as JSON. The format differs slightly between public and private APIs:

**Public endpoints:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "success": false,
  "message": "ERROR MESSAGE",
  "params": []
}
```

**Private endpoints:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": 0,
  "message": "MESSAGE",
  "errors": {
    "PARAM1": ["MESSAGE"],
    "PARAM2": ["MESSAGE"]
  }
}
```

## HTTP Status Codes

For retry strategies, authentication errors, and best practices, see
[Rate Limits & Error Codes](/api-reference/rate-limits).

***

## Endpoint Groups

> **[Market Data](/api-reference/market-data/overview)**
>
> Public market info, orderbook, trades, fees, server status, and more. No authentication required. See [Markets & Trading Pairs](/concepts/markets) for pair notation.

> **[Trading](/api-reference/trading/spot-overview)**
>
> Spot and collateral (margin/futures) trading: orders, order queries, positions, leverage, hedge mode, and kill-switch timers.

> **[Convert](/api-reference/convert/overview)**
>
> Estimate, confirm, and review currency conversion operations.

> **[Account & Wallet](/api-reference/account-wallet/overview)**
>
> Main balance, deposits, withdrawals, transfers, codes, crypto lending, and fees. See [Balances & Transfers](/concepts/balances) for account types.

> **[Travel Rule](/api-reference/travel-rule/overview)**
>
> VASP directory and deposit verification for Travel Rule compliance on crypto transfers.

> **[Sub-Accounts](/api-reference/sub-accounts/overview)**
>
> Create and manage sub-accounts, balances, transfers, and API keys.

> **[Mining Pool](/api-reference/mining-pool/overview)**
>
> Monitor mining operations, manage payouts, track worker performance, and create watcher links.

> **[Address Checker](/api-reference/address-checker/overview)**
>
> Screen blockchain addresses for AML risk before crediting deposits or sending withdrawals.

> **[OAuth](/api-reference/oauth/usage/overview)**
>
> Third-party authorization: token exchange, refresh, OAuth API keys, and account endpoints.

## What's next

* [Authentication](/api-reference/authentication) — Full signing process and common errors
* [Rate Limits & Error Codes](/api-reference/rate-limits) — Per-endpoint limits, error formats, and troubleshooting
* [Market Data](/api-reference/market-data/overview) — Public endpoints for orderbook, trades, and market info
* [Trading](/api-reference/trading/spot-overview) — Spot and collateral orders, queries, and positions
* [WebSocket API](/websocket/overview) — Real-time market data and account streams, plus order management (global platform only)
* [SDKs](/sdks) — Official Go, Python, and PHP SDKs

## Used in these guides

* [Partner Solutions](/guides/partner-solutions) — the partner router that maps use cases to programs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.