Programmatically control your Polymarket copy trading bot, manage wallets, read live portfolio data, and receive webhook events. Available exclusively on the Whale Protocol plan.
Whale Protocol Required: API access is exclusive to Whale Protocol ($149/mo) subscribers. Shadow Trader and Alpha Hunter plans do not include API access. See pricing for plan details.
01
Overview
The Specula API is a RESTful interface that gives you full programmatic control over your Polymarket copy trading bot. Use it to build custom dashboards, trigger trades programmatically, integrate with your own trading infrastructure, or pipe data into analytics pipelines.
What You Can Do
Read your live portfolio balance, P&L, and position breakdown
List, add, and remove wallets from your tracked wallet set
Retrieve real-time trade signals from the copy engine
Pause, resume, and configure your bot remotely
Register webhook endpoints for push-based event delivery
Query the curated leaderboard and Ghost Wallet data
Data Format
All requests and responses use JSON. All monetary values are expressed in USDC with 6 decimal places (matching USDC's on-chain precision). Timestamps are Unix epoch integers (seconds). Wallet addresses are lowercased hex strings prefixed with 0x.
CORS & Usage
The API supports CORS for browser-based clients. For server-side usage (recommended for security), never expose your API key in client-side code. All requests must be made over HTTPS.
02
Authentication
Specula uses API key authentication. Your API key is tied to your wallet address and Whale Protocol subscription. All authenticated requests must include your key in the request header.
Generating Your API Key
Navigate to Dashboard → Settings → API Access and click Generate API Key. Your key is shown once — copy it immediately and store it securely. If lost, you can revoke the key and generate a new one at any time.
API keys are prefixed with pmk_whale_ followed by a 32-character cryptographically random string. Keys are hashed before storage — Specula cannot retrieve your key after generation.
Key Revocation
Revoke your API key immediately if you believe it has been compromised. Active keys can be revoked from Dashboard → Settings → API Access → Revoke. Revocation takes effect within 30 seconds.
# Example authenticated request curl -X GET https://api.specula.app/v1/portfolio \ -H "X-PM-API-Key: pmk_whale_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json"
03
Rate Limits
API requests are rate-limited per API key. Limits reset at midnight UTC each day.
Limit Type
Value
Notes
Daily request limit
500 requests/day
Resets at 00:00 UTC
Per-minute burst
30 requests/minute
Rolling 60-second window
Webhook deliveries
Unlimited
Push events do not count against quota
Max response size
10 MB
Paginate large datasets
Rate Limit Headers
Every response includes rate limit headers:
X-RateLimit-Limit: 500 X-RateLimit-Remaining: 487 X-RateLimit-Reset: 1741305600// UTC epoch of next reset
429 Handling
When you exceed the per-minute burst limit, you receive a 429 Too Many Requests response with a Retry-After header indicating seconds until your burst window resets. Implement exponential backoff in your client.
04
Base URL & Versioning
Base URL:https://api.specula.app/v1 Version:v1 (current stable) Protocol:HTTPS only
The API is versioned via URL path prefix. The current stable version is v1. Breaking changes will be introduced in a new version (v2) with a minimum 90-day deprecation notice. Non-breaking additions (new fields, new endpoints) are added to the current version without notice.
Pagination
List endpoints support cursor-based pagination via cursor and limit query parameters. Responses include a next_cursor field; pass it as the cursor parameter in your next request. Maximum limit is 100. Default is 20.
GET /v1/positions?limit=50&cursor=pos_a7f3d9e2
05
Portfolio Endpoints
Endpoints
GET
/v1/portfolio
Returns your portfolio overview including USDC balance, total P&L, open position count, and 24h/7d performance metrics.
GET
/v1/portfolio/performance
Returns granular performance data. Supports period parameter: 24h, 7d, 30d, all.
Returns current bot status: active, paused, or stopped. Includes uptime since last activation and trade count for current session.
GET
/v1/bot/config
Returns full current bot configuration including all limits, filters, and feature flags.
PATCH
/v1/bot/config
Update bot configuration. Partial updates supported — send only the fields you want to change. Changes take effect on the next signal evaluation cycle.
POST
/v1/bot/pause
Pause the bot. Open positions are maintained; no new trades are executed. Monitoring continues.
POST
/v1/bot/resume
Resume the bot from paused state. The bot begins processing signals immediately.
Each webhook request includes a X-PM-Signature header — an HMAC-SHA256 signature of the raw request body using your webhook secret. Always verify this signature before processing events.
# Node.js verification example const crypto = require('crypto'); const sig = crypto .createHmac('sha256', process.env.PM_WEBHOOK_SECRET) .update(rawBody) .digest('hex'); const valid = sig === req.headers['x-pm-signature'];
11
Error Reference
All errors return a JSON body with error code and human-readable message.
For full SDK support, community libraries, and more advanced examples, visit the GitHub repository. Report API bugs or request new endpoints via GitHub Issues.
We use cookies to enhance your experience. By continuing, you agree to our Cookie Policy.