> For the complete documentation index, see [llms.txt](https://openapi-docs.nagaexchange.co.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openapi-docs.nagaexchange.co.id/readme.md).

# Introduction

Welcome to the **NagaExchange API documentation**. NagaExchange is an Indonesia-based cryptocurrency exchange offering spot and futures trading. This documentation describes the REST and WebSocket APIs available to programmatic traders and integrators.

***

## Example endpoint

{% hint style="info" %}
The example below — Check Server Time — illustrates the general endpoint format: access link, parameters (this particular endpoint takes none), and response fields.
{% endhint %}

### Check Server Time

<mark style="color:blue;">`GET`</mark> `https://openapi.nagaexchange.co.id/sapi/v1/time`

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "timezone": "Western Indonesia Time",
    "serverTime": 1705039779880
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Responses" %}

<table><thead><tr><th width="158">Parameter</th><th width="104">Type</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td>timezone</td><td>string</td><td>Western Indonesia Time</td><td>Server time zone</td></tr><tr><td>serverTime</td><td>long</td><td>1705039779880</td><td>Server timestamp</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Documentation conventions

{% hint style="info" %}
A red **\*** next to a parameter name means the parameter is required. Parameters without it are optional.
{% endhint %}

{% hint style="info" %}
Parameter values are case-sensitive where noted. For example, if an enum value is documented in uppercase, `BUY` is valid but `buy` is not, unless the specific endpoint states otherwise.
{% endhint %}

{% hint style="info" %}
Each parameter has an explicit type and must be sent as that type — for example, an integer parameter must be sent as a number (`3`), not a string (`"3"`).
{% endhint %}

***

## Endpoint security categories

This documentation groups endpoints into two access levels:

* **Public** and **Market** — accessible without an API key or signature.
* **Trade** and **Account** — require a valid API key and a signature on every request.

If the signature is invalid, or a required signing header (`X-CH-SIGN`, `X-CH-APIKEY`, `X-CH-TS`) is missing, the API returns the corresponding error code (e.g. `-1022 INVALID_SIGNATURE`) — see [Error Handling](/error-handling.md) for the full list, and [Authentication](/authentication.md) for the signing specification.

***

## API basic information

* Base URL: `https://openapi.nagaexchange.co.id` (Spot Trading API). Futures Trading API uses a distinct host, `https://futuresopenapi.nagaexchange.co.id` — see [Futures Market Data](/rest-api-futures-trading/market-data.md). The two hosts are not interchangeable.
* All endpoints return either a JSON object or a JSON array.
* Data is returned in **reverse** order — newest first, oldest last.
* All time and timestamp fields are in milliseconds.
* All requests use HTTPS, with the `Content-Type` request header set to `application/json`.
* For `GET` requests, parameters are sent as a query string. For `POST` requests, parameters are sent in the request body.
* Parameters may be sent in any order.

See [Error Handling](/error-handling.md) for the full error code reference, [Rate Limits](/rate-limits.md) for request-frequency limits, and [FAQ](/faq.md) for common integration questions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://openapi-docs.nagaexchange.co.id/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
