Documentation: API

API

Give an external client, like a home screen widget, read-only access to your open positions — no sign-in needed.

API Access

This page manages a read-only REST API for reading your open positions from outside BitMe — build your own integration with it, or use the ready-made example.

Two things live here: Access Tokens, which you generate and revoke, and Positions Feed, which picks what the endpoint returns and includes a ready example for iPhone/Apple Watch (via the free Scriptable app). Neither section can place, close or modify a trade — see "API tokens" below for exactly what the token can read.

API tokens

API tokens let an external client, such as a home screen widget, read your open positions without signing in to the web app.

Create a token on the API page: enter a label (required, so you can tell your tokens apart later) and press Generate Token — this needs a two-factor code, so turn on 2FA in your profile first if you haven't. Press Copy Token and Done when you have copied it; the token is shown only once, and if you lose it, revoke it and create a new one. Revoking a token cuts off that client's access immediately. A token is read-only: it can fetch positions, and can never place or close trades or change settings.

Request:

GET https://bitme.trade/api/v1/positions
Authorization: Bearer {token}

Response:

{ok, positions: [{exchange, symbol, side, size, entry, mark, cost, pnl, pnl_pct}, ...]}

Add ?exchange=bybit,okx and/or ?limit=5 to filter or cap the list for this one request — without them, it uses whatever is picked under "What the feed returns" on the API page (defaults to everything, no cap).

Add ?summary=1 to get a ready-made aggregate instead of the full list, useful for clients that cannot sum arrays or format values themselves:

{count, pnl, pnl_pct, pnl_fmt, pnl_pct_fmt, btc_price, btc_price_fmt, positions_line, marks_line}

The *_fmt fields are ready-to-display strings with sign and currency or percent, and positions_line is every position combined into one string. marks_line lists the current mark price of every open position the same way, preceded by a first line with just the BTC price.

The limit is 30 requests per 60 seconds per token.

Positions Feed

"Exchanges" and "Max positions" pick which exchanges GET /api/v1/positions includes and how many positions it returns at most.

They apply two ways: any client that calls the plain URL with no parameters of its own gets these as defaults, and the widget example below also bakes them into its own request. Positions already come back biggest P&L first, so a lower limit keeps your most significant ones.

Below that, "Example: Apple widget (Scriptable)" shows which fields the copied widget script displays for each position: mark price, entry price, position size and P&L %. Net P&L in dollars always shows — it is the one number the widget exists to surface. The checkboxes and the preview above them only affect the next Copy Widget Script you press; a script you already pasted into Scriptable keeps whatever fields it had when you copied it, since everything is baked into that script's text, not fetched live.

Related guides