Skip to main content
Margin methods are available under nozle.margin and call GET /api/v1/margin/*.

Methods

Date filters

All methods accept optional from and to strings: a YYYY-MM-DD date or an RFC3339 timestamp. A plain date to includes that whole day; an RFC3339 to is an exclusive instant. If you send only one end, the API derives the other (only to: the month before it; only from: until now). Additional string query parameters are forwarded as provided.

Invalid ranges

An unparseable date, or an end that is not after the start, makes the API answer 400. The SDK throws a NozleApiError with the usual margin/summary failed: 400 Bad Request message and the response code on err.code.

Trend granularity

granularity accepts hour, day, week, or month and defaults to day.

Result typing

Margin methods return payloads as unknown; narrow them in your application or validate them with your schema library before use.
The Node SDK does not expose the Margin Simulate API. Call the Margin simulate API directly from your backend when needed.