Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

Polymarket Closed Positions

เอกสาร API
https://api.sandbase.ai/v1/api/polymarket/closed-positions

A wallet's closed positions with realized PnL, newest first, from the Data API v2.

ราคา
$0.012USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
1 จำเป็น · 12 ไม่บังคับ

Playground

อินพุต
The wallet to anchor on. At least one of `user`/`condition` is required.
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-id list is rejected rather than silently truncated.
01000
First-page size. Ignored when `cursor` is supplied (the cursor's size wins). ช่วง: 0 ถึง 1000.
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.
Event id(s), comma-separated (at most 20 distinct values). User-anchored only.
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 carried by the cursor: re-send it on every page of a walk (like `condition` and the
`CASH` or `TOKENS`; defaults to `TOKENS` (the /v2/trades-homogenized filter pair, replacing the former `size_threshold`).
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 boundary). `CASH`: minimum mark-to-market `current_value` in USDC, on top of the
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.
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 and status. On `REDEEMABLE`, the existing winners-first partition remains ahead of
Inclusive lower bound on `last_event_at`, epoch seconds; omit or `0` for unbounded (the `/v2/activity` + `/v2/trades` vocabulary).
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 asks which positions moved inside it, and a row with no clock has no answer. Un
`ASC` or `DESC`; defaults to `DESC`.
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

API README

Polymarket Closed Positions API

Returns a wallet's closed Polymarket positions, newest first, with realized PnL, average entry price and market details for each position. It needs a user wallet address. You can narrow the list by market, event or title.

Use cases

  • Audit a trader's best and worst settled bets by sorting on REALIZED_PNL.
  • Build a win/loss history for a wallet over a date window using start and end.
  • Check how a wallet performed in one event, such as a single match, with event_id or condition.
  • Search a wallet's past positions by market title text, such as a team or country name.

Request

curl -X POST "https://api.sandbase.ai/v1/api/polymarket/closed-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.

Parameters

NameTypeRequiredDescription
userstringYesThe wallet to anchor on. At least one of user/condition is required.
conditionstringNoCondition 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
cursorstringNoOpaque 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.
endintegerNoInclusive 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_idstringNoEvent id(s), comma-separated (at most 20 distinct values). User-anchored only.
filter_amountnumberNoThe 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_typestringNoCASH or TOKENS; defaults to TOKENS (the /v2/trades-homogenized filter pair, replacing the former size_threshold).
include_archivedbooleanNoAlso 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.
limitintegerNoFirst-page size. Ignored when cursor is supplied (the cursor's size wins).
sort_bystringNoOne 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_directionstringNoASC or DESC; defaults to DESC.
startintegerNoInclusive lower bound on last_event_at, epoch seconds; omit or 0 for unbounded (the /v2/activity + /v2/trades vocabulary).
titlestringNoCase-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

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": [
    {
      "archived": false,
      "avg_price": 0.5412,
      "condition_id": "0xcd84f901e5b49d769f43d1d78fdf5e913bd736be0dedb7acff688b9655e04ca4",
      "current_price": 1.0,
      "current_size": 0.0,
      "current_value": 0.0,
      "end_date": "2026-07-14",
      "entry_cost_usdc": 0.0,
      "entry_fees_usdc": 5248.774259,
      "event_id": "655090",
      "event_slug": "mlb-atl-pit-2026-07-07",
      "first_entry_at": 1783464052
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 2,
    "next_cursor": "eyJkYXRhIjp7InR5cGUiOiJwb3NpdGlvbnMiLCJwYXJhbXMiOnsibCI6MiwiZCI6MiwiayI6IjM4Njk5…",
    "offset": 0
  }
}

Response fields

FieldMeaning
data[].title / data[].slug / data[].event_slugMarket title and the slugs that identify the market and its event.
data[].condition_id / data[].token_idIdentifiers for the market condition and the outcome token the wallet held. Use condition_id in the condition filter.
data[].outcome / data[].opposite_outcomeThe outcome the wallet held and the other side of the same market.
data[].avg_priceAverage entry price of the position, between 0 and 1.
data[].realized_pnl / data[].total_pnlProfit or loss locked in on the position. For closed rows both values match and unrealized_pnl is 0.0.
data[].percent_realized_pnlRealized profit as a percentage figure, for example 84.6171.
data[].total_size / data[].total_cost_usdc / data[].entry_fees_usdcTotal shares bought, total cost in USDC, and fees paid in USDC.
data[].first_entry_at / data[].last_event_atEpoch second timestamps of the wallet's first entry and its latest event on the position. last_event_at drives the sort order and the start/end filters.
data[].current_priceLatest price of the outcome. A value of 1.0 on a closed row means the outcome won.
pagination.has_more / pagination.next_cursorShows whether more rows exist and gives the cursor for the next page.

Notes

  • Pass pagination.next_cursor back as cursor to get the next page. The cursor sets the page size, so limit is ignored when you send it.
  • Re-send filters such as title and condition on every page of a walk, because the cursor does not carry them.
  • condition_id values are hex strings. event_id is a numeric string. Timestamps are epoch seconds.
  • To see a wallet's current holdings instead, call Polymarket Wallet Positions.

Pricing

$0.012 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

สำรวจเพิ่มเติม

APIs ที่เกี่ยวข้อง

APIs ทั้งหมด
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

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ Polymarket Closed Positions API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/polymarket/closed-positions โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

Polymarket Closed Positions API ราคาเท่าไร?

$0.012 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

Polymarket Closed Positions API รับพารามิเตอร์อะไรบ้าง?

ที่ต้องระบุ: user (string). ตัวเลือก: condition (string), limit (integer), cursor (string), event_id (string), title (string) และ filter_type (string) และอีก 6 รายการ ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

Polymarket Closed Positions API ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ Polymarket ไหม?

ไม่จำเป็น Polymarket Closed Positions ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Polymarket API แยกต่างหาก