API reference · Polymarket
polymarket/activity
Integrate this model through SandBase's unified API, with production-ready schemas and examples.
Production endpoint
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
POST
https://api.sandbase.ai/v1/api/polymarket/activityModel ID
polymarket/activity01
Input Schema
12 parameters · 1 required · 11 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
user | string | Required | User Profile Address (0x-prefixed, 40 hex chars) |
end | integer | Optional | Upper-bound timestamp (epoch seconds) for the activity window. Omit for the default (current time); rows newer than `end` are excluded. · Min: 0 |
side | string | Optional | side · Options: BUY, SELL BUYSELL |
type | string[] | Optional | Comma-separated list of activity types to include. DEPOSIT and WITHDRAWAL records also require `excludeDepositsWithdrawals=false`. |
limit | integer | Optional | Page size. Values above the maximum are clamped to 500. · Min: 0 · Max: 500 · Default: 100 |
start | integer | Optional | Lower-bound timestamp (epoch seconds) for the activity window. Omit or pass `0` for the default window (most recent ~3 years); pass a positive epoch (e.g. `1`) to retrieve full history. With `sortDirection=ASC`, omitting `start` already reads from the beginning of the account's history (no default w · Min: 0 |
market | string[] | Optional | Comma-separated list of condition IDs. Mutually exclusive with eventId. |
offset | integer | Optional | Starting index for pagination. Requests past the cap are rejected with a 400 (never silently clamped). To read history deeper than offset 5000, page inside `start`/`end` windows — each window has its own offset budget. · Min: 0 · Max: 5000 · Default: 0 |
sortBy | string | Optional | sortBy · Options: TIMESTAMP, TOKENS, CASH · Default: "TIMESTAMP" TIMESTAMPTOKENSCASH |
eventId | integer[] | Optional | Comma-separated list of event IDs. Mutually exclusive with market. |
sortDirection | string | Optional | `DESC` (default) returns the newest rows first; `ASC` the oldest first. Both orders are stable — the same query returns the same rows at any `limit`/`offset`, so pages compose without gaps or repeats. · Options: ASC, DESC · Default: "DESC" ASCDESC |
excludeDepositsWithdrawals | boolean | Optional | Excludes deposit and withdrawal records. The default `true` applies even when `type` requests those records, so to get deposits and withdrawals you must pass `false`. · Default: true |
02
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
03
Code Examples
Ready-to-run snippets
const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1/api/polymarket/activity", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"user": "0x56687bf447db6ffa42ffe2204a05edaa20f55839",
"limit": 100,
"offset": 0,
"sortBy": "TIMESTAMP",
"sortDirection": "DESC",
"excludeDepositsWithdrawals": true
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());