> For the complete documentation index, see [llms.txt](https://earnbit.gitbook.io/earnbit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://earnbit.gitbook.io/earnbit/developers/rest-api.md).

# REST API

#### Public endpoints

No authentication needed. Use `GET`.

Market data: pairs list, pair statistics, order book, market history, depth, and candlestick (KLine) data.

#### Private endpoints

Authenticated with your API key. Use `POST`.

Trading and account: create a limit order, cancel an order, active orders, balances, order info, trade info and order history.

#### Authentication in short

Every private request is a `POST` with:

* a JSON body containing `request` (the endpoint path, for example `/api/v1/account/balance`), a `nonce` (a 13-digit number, always increasing; use the Unix time in milliseconds) and the endpoint's parameters
* headers:
  * `X-TXC-APIKEY`: your public key
  * `X-TXC-PAYLOAD`: the body, base64-encoded
  * `X-TXC-SIGNATURE`: `hex(HMAC_SHA512(payload, secret_key))`

{% hint style="warning" %}
Do not send two private requests at the same moment with the same nonce, or one will be rejected.
{% endhint %}

#### Full reference

Full details and code samples:

{% content-ref url="/pages/sYbe5XonYezaLdwH7WHY" %}
[Public endpoints | HTTP](/earnbit/developers/exchange-api-documentation/public-endpoints-or-http.md)
{% endcontent-ref %}

{% content-ref url="/pages/0ZvFoPS8qDPFyQHIIPtt" %}
[Private endpoints | HTTP](/earnbit/developers/exchange-api-documentation/private-endpoints-or-http.md)
{% endcontent-ref %}

{% content-ref url="/pages/wYSAveRDc5aTVMKxJfGD" %}
[Authentication and API Keys](/earnbit/developers/exchange-api-documentation/private-endpoints-or-http/authentication-and-api-keys.md)
{% endcontent-ref %}
