Skip to Content

History

Paginated order and trade history for any authenticated API-key user — including cancelled and currently open orders. Order and trade lists support both offset pagination (page / pageSize) and opaque keyset pagination (cursor / nextCursor). Prefer the cursor: take nextCursor from one response and pass it as cursor to the next. Do not derive “has more” from total alone (total for orders is capped at about 10000).

Endpoints

MethodPathDescription
GET/api/history/ordersOrder history
GET/api/history/tradesTrade history
GET/api/history/orders/cancelledCancelled orders
GET/api/history/orders/activeActive open orders

Order history

GET /api/history/orders

Returns paginated order history for the authenticated user.

Request

import axios from 'axios'; const response = await axios.get('https://api.loafmarkets.com/api/history/orders', { headers: { Authorization: `Bearer ${process.env.LOAF_API_KEY}` }, }); console.log(response.data);

Parameters

ParameterTypeRequiredDescription
pagenumberNo(query) Page number (1-based). Default: 1.
pageSizenumberNo(query) Results per page (1–100). Default: 20.
cursorstringNo(query) Opaque keyset cursor from a previous response’s nextCursor. Prefer this over page for stable paging.

Response

// See @loafmarkets/shared-types for the response type type Response = Record<string, unknown>;

Example response:

{ "success": true }

Errors

StatusCodeDescription
400validation_errorRequest failed schema validation.
401unauthorizedMissing or invalid authentication.
404not_foundResource not found (where applicable).
500internal_errorUnexpected server error.

Requires API key authentication. Prefer cursor pagination: pass the previous nextCursor as cursor. total for orders is capped (~10000) — do not use it alone to decide whether more pages exist.


Trade history

GET /api/history/trades

Returns paginated trade history for the authenticated user.

Request

import axios from 'axios'; const response = await axios.get('https://api.loafmarkets.com/api/history/trades', { headers: { Authorization: `Bearer ${process.env.LOAF_API_KEY}` }, }); console.log(response.data);

Parameters

ParameterTypeRequiredDescription
pagenumberNo(query) Page number (1-based). Default: 1.
pageSizenumberNo(query) Results per page (1–100). Default: 20.
cursorstringNo(query) Opaque keyset cursor from a previous response’s nextCursor. Prefer this over page for stable paging.

Response

// See @loafmarkets/shared-types for the response type type Response = Record<string, unknown>;

Example response:

{ "success": true }

Errors

StatusCodeDescription
400validation_errorRequest failed schema validation.
401unauthorizedMissing or invalid authentication.
404not_foundResource not found (where applicable).
500internal_errorUnexpected server error.

Requires API key authentication. Prefer cursor pagination: pass the previous nextCursor as cursor.


Cancelled orders

GET /api/history/orders/cancelled

Returns cancelled orders for any authenticated API-key user.

Request

import axios from 'axios'; const response = await axios.get('https://api.loafmarkets.com/api/history/orders/cancelled', { headers: { Authorization: `Bearer ${process.env.LOAF_API_KEY}` }, }); console.log(response.data);

Parameters

ParameterTypeRequiredDescription
None-NoNo parameters for this endpoint.

Response

interface CancelledOrdersResponse { cancelledOrders: unknown[]; }

Example response:

{ "cancelledOrders": [] }

Errors

StatusCodeDescription
401unauthorizedMissing or invalid authentication.
500internal_errorUnexpected server error.

Requires API key authentication.


Active orders

GET /api/history/orders/active

Returns currently open orders for any authenticated API-key user.

Request

import axios from 'axios'; const response = await axios.get('https://api.loafmarkets.com/api/history/orders/active', { headers: { Authorization: `Bearer ${process.env.LOAF_API_KEY}` }, }); console.log(response.data);

Parameters

ParameterTypeRequiredDescription
None-NoNo parameters for this endpoint.

Response

interface ActiveOrdersResponse { activeOrders: unknown[]; }

Example response:

{ "activeOrders": [] }

Errors

StatusCodeDescription
401unauthorizedMissing or invalid authentication.
500internal_errorUnexpected server error.

Requires API key authentication.

Last updated on