API reference · Polymarket

polymarket/activity

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

APISynchronousOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/api/polymarket/activity
Model IDpolymarket/activity
01

Input Schema

12 parameters · 1 required · 11 optional

ParameterTypeRequiredDescription
userstringRequiredUser Profile Address (0x-prefixed, 40 hex chars)
endintegerOptionalUpper-bound timestamp (epoch seconds) for the activity window. Omit for the default (current time); rows newer than `end` are excluded. · Min: 0
sidestringOptionalside · Options: BUY, SELL
BUYSELL
typestring[]OptionalComma-separated list of activity types to include. DEPOSIT and WITHDRAWAL records also require `excludeDepositsWithdrawals=false`.
limitintegerOptionalPage size. Values above the maximum are clamped to 500. · Min: 0 · Max: 500 · Default: 100
startintegerOptionalLower-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
marketstring[]OptionalComma-separated list of condition IDs. Mutually exclusive with eventId.
offsetintegerOptionalStarting 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
sortBystringOptionalsortBy · Options: TIMESTAMP, TOKENS, CASH · Default: "TIMESTAMP"
TIMESTAMPTOKENSCASH
eventIdinteger[]OptionalComma-separated list of event IDs. Mutually exclusive with market.
sortDirectionstringOptional`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
excludeDepositsWithdrawalsbooleanOptionalExcludes 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

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-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());