|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Loading prices...
API Reference

User Data API

Access user-specific data including balances, positions, orders, and trade history.

All user data endpoints require valid Polymarket API credentials. See the Authentication section.

Available Endpoints

GET/api/user/balance
Portfolio balance
GET/api/user/positions
Open positions
GET/api/user/orders
Active orders
GET/api/user/trades
Trade history
GET/api/user/history
Full history

Get Balance

Retrieve the user's portfolio and cash balances:

curl "http://localhost:3000/api/user/balance?address=0xYourAddress"

Response

{
  "portfolioValue": 1250.50,
  "cashBalance": 500.00,
  "totalValue": 1750.50
}

Get Positions

Retrieve all open positions for a user:

curl "http://localhost:3000/api/user/positions?address=0xYourAddress"

Response

{
  "positions": [
    {
      "marketId": "...",
      "outcome": "YES",
      "size": 100,
      "avgPrice": 0.45,
      "currentPrice": 0.65,
      "unrealizedPnl": 20.00
    }
  ]
}

Get Orders

Retrieve all active (unfilled) orders:

curl "http://localhost:3000/api/user/orders?address=0xYourAddress&credentials=ENCODED_CREDENTIALS"

Response

{
  "orders": [
    {
      "orderId": "...",
      "marketId": "...",
      "side": "BUY",
      "outcome": "YES",
      "price": 0.60,
      "size": 50,
      "filledSize": 0,
      "status": "OPEN",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}
Pass API credentials as a URL-encoded JSON object in the credentials query parameter.

Privacy, scoping, and pagination

User endpoints return sensitive financial data. Never proxy them through a public cache. Scope queries to the wallet or account you own, and avoid logging full addresses in shared analytics. If an endpoint supports pagination or time windows, use them to keep payloads small for mobile clients.

When you build admin or support tools, gate access behind your own authentication and audit each lookup. Credentials in query strings can leak via referrer headers—prefer POST bodies or server-side vault lookups in production architectures.