{ "openapi": "3.1.0", "info": { "title": "0xinsider API", "description": "Prediction market intelligence API — trader grades, whale trades, smart money signals, and insider detection. For AI agents, trading bots, and research tools.", "version": "1.0.0", "contact": { "name": "0xinsider", "email": "support@0xinsider.com", "url": "https://0xinsider.com" } }, "servers": [ { "url": "https://api.0xinsider.com", "description": "Production" } ], "security": [ { "bearerAuth": [] } ], "paths": { "/api/v1/trader/{address}": { "get": { "operationId": "get_trader", "summary": "Get trader intelligence", "description": "Returns a trader's grade (S through F), P&L, win rate, and optional strategy/category data. Unknown addresses return sync_status \"unknown\" instead of 404.", "tags": ["Traders"], "parameters": [ { "name": "address", "in": "path", "required": true, "description": "Ethereum wallet address (0x...)", "schema": { "type": "string" } }, { "name": "expand[]", "in": "query", "required": false, "description": "Include heavy fields. Repeatable: strategy, categories, quant_metrics.", "schema": { "type": "string", "enum": ["strategy", "categories", "quant_metrics"] }, "style": "form", "explode": true } ], "responses": { "200": { "description": "Trader profile", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "meta"], "properties": { "object": { "type": "string", "const": "trader" }, "data": { "$ref": "#/components/schemas/Trader" }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" } } } }, "/api/v1/whale-trades": { "get": { "operationId": "get_whale_trades", "summary": "List whale trades", "description": "Returns recent large trades with signal scoring. Filter by size, category, or trader grade. Cursor-paginated, newest first.", "tags": ["Whale Trades"], "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }, { "name": "cursor", "in": "query", "description": "Pagination cursor from previous response's next_cursor.", "schema": { "type": "string" } }, { "name": "min_size", "in": "query", "description": "Minimum trade size in USD.", "schema": { "type": "number", "default": 5000 } }, { "name": "category", "in": "query", "description": "Filter by market category (case-insensitive).", "schema": { "type": "string" } }, { "name": "min_grade", "in": "query", "description": "Minimum trader grade.", "schema": { "type": "string", "enum": ["S", "A", "B", "C", "D", "F"] } } ], "responses": { "200": { "description": "List of whale trades", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "has_more", "meta"], "properties": { "object": { "type": "string", "const": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/WhaleTrade" } }, "has_more": { "type": "boolean" }, "next_cursor": { "type": "string", "nullable": true }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/v1/leaderboard": { "get": { "operationId": "get_leaderboard", "summary": "Get trader leaderboard", "description": "Returns ranked traders (grades S/A/B) sorted by score descending. Supports cursor pagination and optional category/strategy filters.", "tags": ["Leaderboard"], "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }, { "name": "cursor", "in": "query", "description": "Pagination cursor (score_address format).", "schema": { "type": "string" } }, { "name": "category", "in": "query", "description": "Filter by category slug.", "schema": { "type": "string" } }, { "name": "strategy", "in": "query", "description": "Filter by strategy type.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Ranked trader list", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "has_more", "meta"], "properties": { "object": { "type": "string", "const": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/LeaderboardEntry" } }, "has_more": { "type": "boolean" }, "next_cursor": { "type": "string", "nullable": true }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/v1/markets/search": { "get": { "operationId": "search_markets", "summary": "Search markets", "description": "Search prediction markets by keyword. Returns matching markets with status and category.", "tags": ["Markets"], "parameters": [ { "name": "q", "in": "query", "required": true, "description": "Search query.", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }, { "name": "status", "in": "query", "description": "Filter by market status.", "schema": { "type": "string", "enum": ["active", "closed", "all"], "default": "all" } }, { "name": "category", "in": "query", "description": "Filter by category.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Search results", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "has_more", "meta"], "properties": { "object": { "type": "string", "const": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/MarketSearchResult" } }, "has_more": { "type": "boolean" }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/v1/markets/explore": { "get": { "operationId": "explore_markets", "summary": "Explore markets", "description": "Browse whale-active markets with category, platform, status, and keyword filters. Returns a grouped discovery feed where entries are either standalone markets or event groups.", "tags": ["Markets"], "parameters": [ { "name": "category", "in": "query", "description": "Filter by inferred market category.", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Filter by market status.", "schema": { "type": "string", "enum": ["active", "closed", "all"], "default": "all" } }, { "name": "platform", "in": "query", "description": "Filter by source platform.", "schema": { "type": "string", "enum": ["polymarket", "kalshi", "all"], "default": "all" } }, { "name": "sort", "in": "query", "description": "Sort order for the discovery feed.", "schema": { "type": "string", "enum": ["trending", "whales", "volume", "newest"], "default": "trending" } }, { "name": "cursor", "in": "query", "description": "Opaque pagination cursor from the previous response.", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "Page size.", "schema": { "type": "integer", "minimum": 1, "maximum": 48, "default": 24 } }, { "name": "q", "in": "query", "description": "Keyword search against market titles.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Grouped market discovery results", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "has_more", "meta"], "properties": { "object": { "type": "string", "const": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/ExploreEntry" } }, "has_more": { "type": "boolean" }, "next_cursor": { "type": "string", "nullable": true }, "total": { "type": "integer", "nullable": true }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/v1/market/{condition_id}/intel": { "get": { "operationId": "get_market_intel", "summary": "Get market intelligence", "description": "Smart money flow analysis for a specific market — net flow direction, whale trade count, buy/sell volumes, and top graded trader positions.", "tags": ["Markets"], "parameters": [ { "name": "condition_id", "in": "path", "required": true, "description": "Market condition ID.", "schema": { "type": "string" } }, { "name": "timeframe", "in": "query", "description": "Lookback window for whale flow aggregation.", "schema": { "type": "string", "enum": ["1h", "4h", "24h", "7d"], "default": "24h" } } ], "responses": { "200": { "description": "Market intelligence", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "meta"], "properties": { "object": { "type": "string", "const": "market_intel" }, "data": { "$ref": "#/components/schemas/MarketIntel" }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "404": { "$ref": "#/components/responses/NotFound" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/v1/insider-radar": { "get": { "operationId": "get_insider_radar", "summary": "Get insider radar flags", "description": "Suspicious trading patterns — pre-resolution accumulation, coordinated wallets, unusual timing. Cursor-paginated by suspicion score.", "tags": ["Insider Radar"], "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }, { "name": "cursor", "in": "query", "description": "Pagination cursor from previous response.", "schema": { "type": "string" } }, { "name": "min_suspicion", "in": "query", "description": "Minimum suspicion score (0-100).", "schema": { "type": "number", "default": 0 } }, { "name": "severity", "in": "query", "description": "Filter by severity level.", "schema": { "type": "string", "enum": ["flag", "watch"] } } ], "responses": { "200": { "description": "Radar flags list", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "has_more", "meta"], "properties": { "object": { "type": "string", "const": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/RadarFlag" } }, "has_more": { "type": "boolean" }, "next_cursor": { "type": "string", "nullable": true }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "$ref": "#/components/responses/SubscriptionRequired" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/v1/health": { "get": { "operationId": "health", "summary": "Health check", "description": "Returns API health status. No authentication required.", "tags": ["System"], "security": [], "responses": { "200": { "description": "Health status", "content": { "application/json": { "schema": { "type": "object", "required": ["object", "data", "meta"], "properties": { "object": { "type": "string", "const": "health" }, "data": { "type": "object", "properties": { "status": { "type": "string", "enum": ["ok", "degraded", "down", "maintenance"] }, "db": { "type": "boolean" }, "cache": { "type": "boolean" } } }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "API key: Authorization: Bearer oxi_sk_live_..." } }, "schemas": { "ResponseMeta": { "type": "object", "required": ["request_id", "cached"], "properties": { "request_id": { "type": "string", "description": "Unique request ID (req_ prefix)." }, "cached": { "type": "boolean" }, "cache_age_s": { "type": "integer", "nullable": true, "description": "Cache age in seconds, null if not cached." } } }, "Trader": { "type": "object", "required": ["id", "address", "pnl", "stats"], "properties": { "id": { "type": "string", "description": "Prefixed ID (trd_...)." }, "address": { "type": "string" }, "username": { "type": "string", "nullable": true }, "grade": { "type": "string", "enum": ["S", "A", "B", "C", "D", "F"], "nullable": true }, "score": { "type": "number", "nullable": true }, "rank": { "type": "integer", "nullable": true }, "pnl": { "type": "object", "properties": { "total": { "type": "number", "nullable": true }, "realized": { "type": "number", "nullable": true }, "unrealized": { "type": "number", "nullable": true }, "last_7d": { "type": "number", "nullable": true }, "last_30d": { "type": "number", "nullable": true } } }, "stats": { "type": "object", "properties": { "markets_traded": { "type": "integer", "nullable": true }, "win_rate": { "type": "number", "nullable": true }, "daily_win_rate": { "type": "number", "nullable": true }, "total_volume": { "type": "number", "nullable": true } } }, "strategy": { "type": "object", "nullable": true, "properties": { "strategy_type": { "type": "string" }, "description": { "type": "string", "nullable": true }, "confidence": { "type": "number", "nullable": true } } }, "category_strengths": { "type": "array", "nullable": true, "description": "Category performance breakdown (expand[]=categories). Null unless expanded.", "items": { "type": "object", "properties": { "category": { "type": "string" }, "grade": { "type": "string", "nullable": true }, "rank": { "type": "integer", "nullable": true }, "markets": { "type": "integer", "nullable": true }, "pnl": { "type": "number", "nullable": true } } } }, "quant_metrics": { "type": "object", "nullable": true, "description": "Advanced risk/performance metrics (expand[]=quant_metrics). Null unless expanded.", "properties": { "sharpe_ratio": { "type": "number", "nullable": true, "description": "Risk-adjusted return (annualized)" }, "sortino_ratio": { "type": "number", "nullable": true, "description": "Downside risk-adjusted return" }, "max_drawdown": { "type": "number", "nullable": true, "description": "Largest peak-to-trough decline (0.0-1.0)" }, "profit_factor": { "type": "number", "nullable": true, "description": "Gross profit / gross loss" }, "kelly_fraction": { "type": "number", "nullable": true, "description": "Optimal bet size (Kelly criterion)" }, "sharpe_percentile": { "type": "number", "nullable": true, "description": "Percentile rank among all traders" } } }, "last_active": { "type": "string", "format": "date-time", "nullable": true }, "synced_at": { "type": "string", "format": "date-time", "nullable": true }, "sync_status": { "type": "string", "nullable": true, "description": "synced, unknown, or pending." } } }, "WhaleTrade": { "type": "object", "required": ["id", "traded_at", "size_usd", "side", "price", "signal_score", "trader", "market"], "properties": { "id": { "type": "string", "description": "Prefixed ID (wt_...)." }, "traded_at": { "type": "string", "format": "date-time" }, "size_usd": { "type": "number" }, "side": { "type": "string", "enum": ["BUY", "SELL"] }, "price": { "type": "number" }, "signal_score": { "type": "number", "description": "0.0–1.0 normalized signal score." }, "trader": { "type": "object", "required": ["id", "address"], "properties": { "id": { "type": "string" }, "address": { "type": "string" }, "username": { "type": "string", "nullable": true }, "grade": { "type": "string", "nullable": true } } }, "market": { "type": "object", "required": ["id", "condition_id", "title"], "properties": { "id": { "type": "string" }, "condition_id": { "type": "string" }, "title": { "type": "string" }, "slug": { "type": "string", "nullable": true }, "category": { "type": "string", "nullable": true } } } } }, "LeaderboardEntry": { "type": "object", "required": ["id", "address", "platform"], "properties": { "id": { "type": "string" }, "address": { "type": "string" }, "username": { "type": "string", "nullable": true }, "grade": { "type": "string", "nullable": true }, "score": { "type": "number", "nullable": true }, "pnl": { "type": "number", "nullable": true }, "volume": { "type": "number", "nullable": true }, "markets_traded": { "type": "integer", "nullable": true }, "win_rate": { "type": "number", "nullable": true }, "strategy_type": { "type": "string", "nullable": true }, "platform": { "type": "string" }, "last_active": { "type": "string", "format": "date-time", "nullable": true } } }, "MarketSearchResult": { "type": "object", "required": ["id", "condition_id", "title", "status"], "properties": { "id": { "type": "string" }, "condition_id": { "type": "string" }, "title": { "type": "string" }, "slug": { "type": "string", "nullable": true }, "category": { "type": "string", "nullable": true }, "platform": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": ["active", "resolved"] } } }, "ExploreMarket": { "type": "object", "required": ["id", "condition_id", "title", "status"], "properties": { "id": { "type": "string" }, "condition_id": { "type": "string" }, "title": { "type": "string" }, "slug": { "type": "string", "nullable": true, "description": "Provider-native market slug." }, "url_slug": { "type": "string", "nullable": true, "description": "First-party market page slug used for internal links." }, "image": { "type": "string", "nullable": true }, "icon": { "type": "string", "nullable": true }, "category": { "type": "string", "nullable": true }, "platform": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": ["active", "resolved"] }, "volume": { "type": "number", "nullable": true }, "liquidity": { "type": "number", "nullable": true }, "whale_trade_count": { "type": "integer", "nullable": true }, "whale_distinct_wallets": { "type": "integer", "nullable": true }, "whale_total_usd": { "type": "number", "nullable": true }, "whale_last_trade_at": { "type": "string", "format": "date-time", "nullable": true }, "end_date": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time", "nullable": true }, "outcome_yes": { "type": "string", "nullable": true }, "outcome_no": { "type": "string", "nullable": true }, "event_slug": { "type": "string", "nullable": true }, "kalshi_series_slug": { "type": "string", "nullable": true }, "smart_score": { "type": "number", "nullable": true }, "smart_count": { "type": "integer", "nullable": true }, "smart_label": { "type": "string", "nullable": true }, "open_interest": { "type": "number", "nullable": true }, "oi_change_pct": { "type": "number", "nullable": true }, "price_points": { "type": "array", "nullable": true, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number" } } } } }, "ExploreGroup": { "type": "object", "required": ["type", "event_slug", "parent_title", "markets"], "properties": { "type": { "type": "string", "const": "group" }, "event_slug": { "type": "string" }, "parent_title": { "type": "string" }, "image": { "type": "string", "nullable": true }, "platform": { "type": "string", "nullable": true }, "category": { "type": "string", "nullable": true }, "markets": { "type": "array", "items": { "$ref": "#/components/schemas/ExploreMarket" } }, "rep_volume": { "type": "number", "nullable": true }, "rep_whales": { "type": "integer", "nullable": true } } }, "ExploreStandalone": { "type": "object", "required": ["type", "market"], "properties": { "type": { "type": "string", "const": "standalone" }, "market": { "$ref": "#/components/schemas/ExploreMarket" } } }, "ExploreEntry": { "oneOf": [ { "$ref": "#/components/schemas/ExploreGroup" }, { "$ref": "#/components/schemas/ExploreStandalone" } ], "discriminator": { "propertyName": "type", "mapping": { "group": "#/components/schemas/ExploreGroup", "standalone": "#/components/schemas/ExploreStandalone" } } }, "MarketIntel": { "type": "object", "required": ["market", "smart_money", "timeframe"], "properties": { "market": { "type": "object", "required": ["id", "condition_id", "title"], "properties": { "id": { "type": "string" }, "condition_id": { "type": "string" }, "title": { "type": "string" }, "slug": { "type": "string", "nullable": true }, "category": { "type": "string", "nullable": true }, "platform": { "type": "string", "nullable": true } } }, "smart_money": { "type": "object", "required": ["net_flow_usd", "direction", "whale_trade_count", "buy_volume_usd", "sell_volume_usd", "top_positions"], "properties": { "net_flow_usd": { "type": "number" }, "direction": { "type": "string", "enum": ["YES", "NO"] }, "whale_trade_count": { "type": "integer" }, "buy_volume_usd": { "type": "number" }, "sell_volume_usd": { "type": "number" }, "top_positions": { "type": "array", "items": { "type": "object", "required": ["id", "address", "side", "size_usd"], "properties": { "id": { "type": "string" }, "address": { "type": "string" }, "username": { "type": "string", "nullable": true }, "grade": { "type": "string", "nullable": true }, "side": { "type": "string", "enum": ["YES", "NO"] }, "size_usd": { "type": "number" } } } } } }, "timeframe": { "type": "string" } } }, "RadarFlag": { "type": "object", "required": ["id", "suspicion_score", "severity", "trader", "market", "scores", "evidence", "created_at"], "properties": { "id": { "type": "string", "description": "Prefixed ID (rf_...)." }, "suspicion_score": { "type": "number" }, "severity": { "type": "string", "enum": ["flag", "watch"] }, "trader": { "type": "object", "required": ["id", "address"], "properties": { "id": { "type": "string" }, "address": { "type": "string" }, "username": { "type": "string", "nullable": true } } }, "market": { "type": "object", "required": ["id", "condition_id", "title"], "properties": { "id": { "type": "string" }, "condition_id": { "type": "string" }, "title": { "type": "string" } } }, "scores": { "type": "object", "properties": { "timing": { "type": "number", "nullable": true }, "edge": { "type": "number", "nullable": true }, "size": { "type": "number", "nullable": true }, "fresh_wallet": { "type": "number", "nullable": true } } }, "evidence": { "description": "Structured evidence JSON." }, "created_at": { "type": "string", "format": "date-time" } } }, "ApiError": { "type": "object", "required": ["object", "error", "meta"], "properties": { "object": { "type": "string", "const": "error" }, "error": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "doc_url": { "type": "string", "nullable": true }, "param": { "type": "string", "nullable": true } } }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } } } }, "responses": { "BadRequest": { "description": "Invalid request parameter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "Unauthorized": { "description": "Missing or invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "SubscriptionRequired": { "description": "Active Insider subscription required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "NotFound": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "RateLimited": { "description": "Rate limit exceeded (100 req/min)", "headers": { "Retry-After": { "description": "Seconds until rate limit resets.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "schema": { "type": "integer" } }, "X-RateLimit-Remaining": { "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "schema": { "type": "integer" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "InternalError": { "description": "Unexpected server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }