# Exchange API Documentation

## HTTP API

### Public endpoints

Public endpoints are ideal for retrieving general data and are accessible without the need for an API key. These endpoints use the `GET` method for requests. Each public endpoint can also be used as a `POST` request with [authentication](/earnbit/exchange-api-documentation/private-endpoints-or-http/authentication-and-api-keys.md) (similar to [private endpoints](/earnbit/exchange-api-documentation/private-endpoints-or-http.md)) to allow you to access more data.

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

### Private endpoints

Private endpoints offer full access to data and features. To use these endpoints, an[ API key](/earnbit/exchange-api-documentation/private-endpoints-or-http/authentication-and-api-keys.md) is required, which you can generate directly from your EarnBIT Exchange profile.

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

## WEBSOKET API

### Basic structure

This section describes the basic structure of WS requests and responses.

{% content-ref url="/pages/iyWTXKP8B5TiskeJ10x9" %}
[Basic structure | WEBSOKET](/earnbit/exchange-api-documentation/basic-structure-or-websoket.md)
{% endcontent-ref %}

### Public methods

Methods to access public data like market history, order book, etc. After establishing the WebSocket connection, the user does not need to be authorized to use these methods.

{% content-ref url="/pages/IRKqu94NGix4A2A9nVUA" %}
[Public methods | WEBSOKET](/earnbit/exchange-api-documentation/public-methods-or-websoket.md)
{% endcontent-ref %}

### Private methods

Methods to access private data related to balances, orders, etc. After establishing the WebSocket connection, the user has to be [authorized](/earnbit/exchange-api-documentation/private-methods-or-websoket/authorization.md) to use these methods.

{% content-ref url="/pages/S9XMwKHKlYGAYpE69M4o" %}
[Private methods | WEBSOKET](/earnbit/exchange-api-documentation/private-methods-or-websoket.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://earnbit.gitbook.io/earnbit/exchange-api-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
