Upscale
Menu
On this page

Get position events for chart indicators by ticker

Try it out ↓
GET/positions/{accountId}/{asset}/chart-events
Get position events for chart indicators by tickerTrading

Position events of the account on one market inside a time range, newest first — the markers a chart draws.

  • Only increases, closes, force closes and liquidations are returned; funding and margin changes are not chart events.
  • The range is given in whole seconds through executedFrom and executedTo, both inclusive.
  • Limited to the phase the account is currently in.
Base URL https://api.upscale.trade

Authorization

bearerhttp · bearerrequired

Personal API key, prefixed with usk_.

Parameters

Path
accountIdstring · uuidrequired

Trader account identifier. Must belong to the caller.

pattern
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
Example: 00000000-0000-4000-8000-000000000000
assetstringrequired

Base asset ticker of the market, as returned by GET /v2/markets.

minLength
1
Example: BTC
Query
executedFromnumberrequired

Executed from, unix timestamp in seconds (inclusive)

Example: 1735689600
executedTonumberrequired

Executed to, unix timestamp in seconds (inclusive)

Example: 1767225599
limitintegeroptional

Page size: how many events to return.

Default: 20

minimum
1
maximum
1000
Example: 20
offsetintegeroptional

How many events to skip before the page.

Default: 0

minimum
0
maximum
9007199254740991
Example: 0

Examples

curl --request GET 'https://api.upscale.trade/positions/{accountId}/{asset}/chart-events' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Responses

401

Unauthorized

403

The account belongs to another user (account_access_denied), or the request is authenticated with an API key while api_trading is disabled on the account (api_trading_not_enabled).

404

No account with this identifier, or no market for this ticker.

429

Rate limit of the API key exceeded (api_key_rate_limit_exceeded). Retry-After says when to come back; the body carries the bucket (read / write), the window that tripped, its limit and retryAt.

defaultResponseapplication/json
dataobject[]required

Requested page of chart markers, newest first.

Array items · object
assetstringrequired

Base asset ticker of the market the event happened on.

Example: BTC
directionstring · enumrequired

Direction of the position the event belongs to.

Allowed: "long" "short"
Example: long
eventNamestring · enumrequired

What the marker stands for: open for the first increase of a position, increase for later ones, decrease for a partial close, close for a full one and liquidation for a liquidation.

Allowed: "open" "increase" "decrease" "close" "liquidation"
Example: open
executedAtnumberrequired

When the event happened, unix timestamp in seconds.

Example: 1767225599
pricestring · int32required

Price the event executed at, fp9 raw — exchanged quote over exchanged base.

pattern
^(?:-?[1-9][0-9]*|0)$
Example: 1000000000
sizestring · int32required

Absolute size the event moved, in base asset units, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Example: 1000000000
View example
[
  {
    "asset": "BTC",
    "direction": "long",
    "eventName": "open",
    "executedAt": 1767225599,
    "price": "1000000000",
    "size": "1000000000"
  }
]
totalCountnumberrequired

Total number of events in the requested range, across all pages.

Example: 0