userstring必填
The wallet to anchor on. At least one of `user`/`condition` is required.
https://api.sandbase.ai/v1/api/polymarket/positionsA wallet's positions across their lifecycle (open, redeemable, mergeable, closed), with size, average price, current value and PnL.
您的輸出會顯示在這裡
完成輸入後,點擊執行。
Returns a list of Polymarket positions for one wallet. Each row shows share size, average entry price, current price, current value and PnL. It needs a wallet address in user and filters by status, which defaults to OPEN.
unrealized_pnl or total_pnl to find its best and worst bets.REDEEMABLE so a wallet owner knows which markets to claim.curl -X POST "https://api.sandbase.ai/v1/api/polymarket/positions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user": "0xfe787d2da716d60e8acff57fb87eb13cd4d10319", "limit": 2}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
user | string | Yes | The wallet to anchor on. At least one of user/condition is required. |
condition | string | No | Condition id(s), comma-separated (at most 20 distinct values). With user, narrows that user's positions (all ids honoured). Without user, anchors on the market's holders; exactly one id is accepted there, and a multi |
cursor | string | No | Opaque pagination cursor from a prior response's next_cursor. It carries the page position, page size, and the status/sort/direction it was minted under. |
end | integer | No | Inclusive upper bound on last_event_at, epoch seconds; omit or 0 for unbounded. A position with no native economics carries no last_event_at and is therefore excluded by any bound, in either direction; a window |
event_id | string | No | Event id(s), comma-separated (at most 20 distinct values). User-anchored only. |
filter_amount | number | No | The filter floor. TOKENS: minimum CURRENT holding in shares (defaults to the 0.1 dust floor; applies to OPEN/REDEEMABLE; a user's CLOSED set is not narrowed by it, and on a market anchor it moves the OPEN/CLOSED |
filter_type | string | No | CASH or TOKENS; defaults to TOKENS (the /v2/trades-homogenized filter pair, replacing the former size_threshold). |
include_archived | boolean | No | Also include positions on archived markets; defaults to false. OPEN/REDEEMABLE/REDEEMABLE_LOST/MERGEABLE only; combining it with status=CLOSED is rejected. Inactive markets remain excluded either way. |
limit | integer | No | First-page size. Ignored when cursor is supplied (the cursor's size wins). |
sort_by | string | No | One of CURRENT_VALUE, PRICE, TOKENS, UNREALIZED_PNL, REALIZED_PNL, TOTAL_PNL, or TIMESTAMP (the row's last_event_at). PRICE ranks by the response's effective current_price on every supported anchor an |
sort_direction | string | No | ASC or DESC; defaults to DESC. |
start | integer | No | Inclusive lower bound on last_event_at, epoch seconds; omit or 0 for unbounded (the /v2/activity + /v2/trades vocabulary). |
status | string | No | One of OPEN, REDEEMABLE, REDEEMABLE_LOST, MERGEABLE, or CLOSED; defaults to OPEN. REDEEMABLE_LOST requires user, supports all six sorts, and defaults to CURRENT_VALUE; it preserves row status `REDEEMABL |
title | string | No | Case-insensitive market-title substring filter, honoured on every anchor and status. SQL LIKE wildcards (%, _) keep their usual meaning; empty or whitespace-only is treated as absent; at most 200 characters. NOT carr |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": [
{
"archived": false,
"avg_price": 0.8959,
"condition_id": "0xdbcc54e623b74b67ea5a8733639a9f5e43ea16bd9b264ddf8772c615a7790d62",
"current_price": 0.935,
"current_size": 47155.6168,
"current_value": 44090.5017,
"end_date": "2026-11-09",
"entry_cost_usdc": 42248.4147,
"entry_fees_usdc": 0.0,
"event_id": "1289266",
"event_slug": "wta-yastrem-sonmez-2026-11-01",
"first_entry_at": 1793687014
}
],
"pagination": {
"has_more": true,
"limit": 2,
"next_cursor": "eyJkYXRhIjp7InR5cGUiOiJwb3NpdGlvbnMiLCJwYXJhbXMiOnsibCI6MiwiZCI6MiwiayI6IjMxODQw…",
"offset": 0
}
}
| Field | Meaning |
|---|---|
data[].title / data[].outcome | The market question and the outcome this position holds. opposite_outcome names the other side of the market. |
data[].condition_id / data[].token_id | IDs for the market condition and for the outcome token held. opposite_token_id is the token for the other outcome. |
data[].current_size / data[].total_size | current_size is the number of shares held now. total_size is the total share amount shown for the position, which is larger when shares were sold or closed. |
data[].avg_price / data[].current_price | The average entry price and the current price per share. Prices in this response fall between 0 and 1. |
data[].current_value | Mark-to-market value of the position in USDC, based on current_size and current_price. |
data[].entry_cost_usdc / data[].total_cost_usdc / data[].entry_fees_usdc | USDC cost paid to enter the position, the total cost, and the fees paid on entry. |
data[].unrealized_pnl / data[].realized_pnl / data[].total_pnl | PnL on shares still held, PnL from shares already sold, and the combined figure. |
data[].percent_pnl / data[].percent_realized_pnl | PnL shown as percentages. percent_realized_pnl covers the realized part. |
data[].first_entry_at / data[].last_event_at | Epoch-second timestamps of the first entry and the most recent event on the position. |
data[].status / data[].redeemable / data[].mergeable | Lifecycle state of the row, such as OPEN, and flags for whether it can be redeemed or merged. |
pagination.next_cursor as cursor to get the next page. pagination.has_more tells you if another page exists.title, condition and other filters on each page of a walk. The cursor only carries the page position, size, status and sort.status set to CLOSED for ended positions. Polymarket Closed Positions is a related API for that.$0.012 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
開始建置
具備統一驗證與用量追蹤的平台 API 端點。
curl -X POST "https://api.sandbase.ai/v1/api/polymarket/positions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user": "0xfe787d2da716d60e8acff57fb87eb13cd4d10319",
"limit": 2
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
userstring必填The wallet to anchor on. At least one of `user`/`condition` is required.
conditionstringCondition id(s), comma-separated (at most 20 distinct values). With `user`, narrows that user's positions (all ids honoured). Without `user`, anchors on the market's holders; exactly one id is accepted there, and a multi-id list is rejected rather than silently truncated.
limitintegerFirst-page size. Ignored when `cursor` is supplied (the cursor's size wins).
cursorstringOpaque pagination cursor from a prior response's `next_cursor`. It carries the page position, page size, and the status/sort/direction it was minted under.
statusstringOne of `OPEN`, `REDEEMABLE`, `REDEEMABLE_LOST`, `MERGEABLE`, or `CLOSED`; defaults to `OPEN`. `REDEEMABLE_LOST` requires `user`, supports all six sorts, and defaults to `CURRENT_VALUE`; it preserves row status `REDEEMABLE`. `MERGEABLE` is `OPEN` narrowed to live complementary pairs (conditions where
event_idstringEvent id(s), comma-separated (at most 20 distinct values). User-anchored only.
titlestringCase-insensitive market-title substring filter, honoured on every anchor and status. SQL LIKE wildcards (`%`, `_`) keep their usual meaning; empty or whitespace-only is treated as absent; at most 200 characters. NOT carried by the cursor: re-send it on every page of a walk (like `condition` and the
filter_typestring`CASH` or `TOKENS`; defaults to `TOKENS` (the /v2/trades-homogenized filter pair, replacing the former `size_threshold`).
filter_amountnumberThe filter floor. `TOKENS`: minimum CURRENT holding in shares (defaults to the 0.1 dust floor; applies to `OPEN`/`REDEEMABLE`; a user's `CLOSED` set is not narrowed by it, and on a market anchor it moves the OPEN/CLOSED boundary). `CASH`: minimum mark-to-market `current_value` in USDC, on top of the
include_archivedbooleanAlso include positions on archived markets; defaults to `false`. `OPEN`/`REDEEMABLE`/`REDEEMABLE_LOST`/`MERGEABLE` only; combining it with `status=CLOSED` is rejected. Inactive markets remain excluded either way.
sort_bystringOne of `CURRENT_VALUE`, `PRICE`, `TOKENS`, `UNREALIZED_PNL`, `REALIZED_PNL`, `TOTAL_PNL`, or `TIMESTAMP` (the row's `last_event_at`). `PRICE` ranks by the response's effective `current_price` on every supported anchor and status. On `REDEEMABLE`, the existing winners-first partition remains ahead of
startintegerInclusive lower bound on `last_event_at`, epoch seconds; omit or `0` for unbounded (the `/v2/activity` + `/v2/trades` vocabulary).
endintegerInclusive upper bound on `last_event_at`, epoch seconds; omit or `0` for unbounded. A position with no native economics carries no `last_event_at` and is therefore **excluded by any bound**, in either direction; a window asks which positions moved inside it, and a row with no clock has no answer. Un
sort_directionstring`ASC` or `DESC`; defaults to `DESC`.
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
尚未發布已儲存回應。請在 Playground 中執行 API 以檢視其回應。
探索更多
| API | 價格 | 回應 |
|---|---|---|
Polymarket | 每次呼叫 $0.012 | JSON |
Polymarket | 每次呼叫 $0.012 | JSON |
Polymarket | 每次呼叫 $0.012 | JSON |
Polymarket | 每次呼叫 $0.012 | JSON |
Polymarket | 每次呼叫 $0.012 | JSON |
Polymarket | 每次呼叫 $0.012 | JSON |
問題
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/polymarket/positions。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.012,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:user (string)。 選填:condition (string), limit (integer), cursor (string), status (string), event_id (string) 和 title (string),以及另外 7 個。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。Polymarket Wallet Positions 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Polymarket API 存取權。