### Altcoin Dominance Calculation Example Source: https://openmarket.xyz/docs/rest/bitcoin-dominance A concrete example showing the subtraction of Bitcoin dominance from 100. ```Example 100 - 57.1031 = 42.8969 ``` -------------------------------- ### Usage Response Format Source: https://openmarket.xyz/docs/rate-limits Example JSON response structure returned by the usage endpoint. ```JSON { "limit": 1500, "remaining": 1430, "used": 70, "reset": 1712345678, "window_seconds": 60 } ``` -------------------------------- ### Query Market Data with Time Range Source: https://openmarket.xyz/docs/exchanges Examples for requesting 6 hours of hourly candle data using a specific start timestamp and period duration. ```curl curl "https://api.openmarket.xyz/v1/points ?type=TRADE_SIDE_AGNOSTIC_AGG &exchange=BINANCE_FUTURES &rawSymbol=BTCUSDT &interval=HOUR &from=1774800000 &period=21600" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` ```python import requests response = requests.get( "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&rawSymbol=BTCUSDT&interval=HOUR&from=1774800000&period=21600 ", headers={"X-OpenMarket-Key": "YOUR_API_KEY"} ) data = response.json() ``` ```javascript const response = await fetch( "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&rawSymbol=BTCUSDT&interval=HOUR&from=1774800000&period=21600 ", { headers: { "X-OpenMarket-Key": "YOUR_API_KEY" } } ) const data = await response.json() ``` -------------------------------- ### Response Source: https://openmarket.xyz/docs/rest/skew Example JSON response structure for a skew summary query. ```json { "series": [ { "id": { "type": "SKEW_OPTION_SUMMARY_AGG", "exchange": "DERIBIT", "rawSymbol": "BTC_25", "normalizedSymbol": "BTC", "category": "OPTION", "interval": "DAY", "tenor": "ONE_W", "coin": "BTC" }, "points": [ { "Point": { "skew": 9.71701017415855, "timestamp": { "s": 1775692800 } } } ] } ] } ``` -------------------------------- ### Trader Profile Response Format Source: https://openmarket.xyz/docs/rest/polymarket-analytics Example JSON response structure for a trader profile request. ```JSON { "traderProfile": { "wallet_address": "0xf1302aafc43aa3a69bcd8058fc7a0259dac246ab", "total_position_count": 1047, "closed_position_count": 1047, "total_size": 193273897.17371872, "total_realized_pnl": 94916520.2155992, "win_rate_by_positions": 80.70678127984718, "largest_win": 5740012.643231001, "largest_loss": -48.26, "avg_holding_duration": 3429946, "total_closed_pos_value": 193273897.17371872 } } ``` -------------------------------- ### User Positions Response Schema Source: https://openmarket.xyz/docs/rest/polymarket-analytics Example JSON response structure for a user positions query. ```JSON { "userPositions": [ { "wallet_address": "0xf1302aafc43aa3a69bcd8058fc7a0259dac246ab", "asset_id": "69984203794322070924779554468751071533998686576952069110752844084141678897886", "realized_size": 11555027.501624001, "avg_exit_price": 0.49675456353732356, "realized_pnl": 5740012.643231001, "resolved_price": 1, "prev_hold_duration": 14305671, "merge_count": 153, "transfer_in_count": 383, "transfer_out_count": 24, "market_name": "Which party will control the U.S. Senate after the 2022 election?", "outcome_name": "Democratic", "category": "Politics", "sub_category": "US Politics", "condition_id": "0xe0658c4beed2102c181b3987edff5edd578ad2952a6eb5fa8018925e5d7a48fd" } ] } ``` -------------------------------- ### GET /v1/usage Source: https://openmarket.xyz/docs/rate-limits Check your current API quota usage without consuming any weight. ```APIDOC ## GET /v1/usage ### Description Check your current API quota usage without consuming any weight. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/usage ### Response #### Success Response (200) - **limit** (integer) - Your tier's weight budget per minute - **remaining** (integer) - Weight remaining in the current window - **used** (integer) - Weight consumed in the current window - **reset** (integer) - Unix timestamp when the bucket refills to full capacity - **window_seconds** (integer) - The duration of the rate limit window in seconds #### Response Example { "limit": 1500, "remaining": 1430, "used": 70, "reset": 1712345678, "window_seconds": 60 } ``` -------------------------------- ### Polymarket Leaderboard Response Format Source: https://openmarket.xyz/docs/rest/polymarket-analytics Example JSON response structure for the trader leaderboard endpoint. ```JSON { "traderProfiles": [ { "wallet_address": "0xf1302aafc43aa3a69bcd8058fc7a0259dac246ab", "total_position_count": 1047, "closed_position_count": 1047, "total_size": 193273897.17371872, "total_realized_pnl": 94916520.2155992, "win_rate_by_positions": 80.70678127984718, "largest_win": 5740012.643231001, "largest_loss": -48.26, "avg_holding_duration": 3429946, "total_closed_pos_value": 193273897.17371872 } ] } ``` -------------------------------- ### GET /v1/points Source: https://openmarket.xyz/docs/quickstart Retrieves aggregated liquidation data for a specified coin and time interval. ```APIDOC ## GET /v1/points ### Description Retrieves liquidation heatmap data, which provides price levels and corresponding liquidation volumes. This is useful for identifying market stop-hunt zones and liquidation cascades. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/points ### Parameters #### Query Parameters - **type** (string) - Required - The type of data point, e.g., HYPERLIQUID_LIQUIDATION_AGG - **coin** (string) - Required - The ticker symbol of the coin (e.g., BTC) - **interval** (string) - Required - The time interval for aggregation (e.g., HOUR) - **from** (integer) - Required - The start timestamp for the data range - **period** (integer) - Required - The duration of the period in seconds - **transform.normalize.quote** (string) - Required - The quote currency for normalization (e.g., USD) ### Response #### Success Response (200) - **data** (array) - An array of [price, liquidationVolume] pairs. ``` -------------------------------- ### GET /v1/points (Liquidation cascade detector) Source: https://openmarket.xyz/docs/quick-examples Retrieves liquidation volume by price to identify stop-hunt zones. ```APIDOC ## GET /v1/points ### Description Where liquidations cluster by price. Spot stop-hunt zones in real time. ### Method GET ### Endpoint /v1/points ### Parameters #### Query Parameters - **type** (string) - Required - HYPERLIQUID_LIQUIDATION_AGG - **coin** (string) - Required - BTC - **interval** (string) - Required - HOUR - **transform.normalize.quote** (string) - Required - USD ``` -------------------------------- ### GET /v1/points Source: https://openmarket.xyz/docs/rest/liquidation-heatmap Fetches aggregated liquidation heatmap data for a specified coin over a given time interval. ```APIDOC ## GET /v1/points ### Description Retrieves aggregated liquidation heatmap data. This endpoint returns price levels and their corresponding liquidation volumes. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/points ### Parameters #### Query Parameters - **type** (string) - Required - Must be set to 'HYPERLIQUID_LIQUIDATION_AGG' - **coin** (string) - Required - The coin symbol (e.g., BTC) - **interval** (string) - Required - The time interval (e.g., HOUR) - **from** (integer) - Required - Start timestamp - **period** (integer) - Required - Duration of the period in seconds - **transform.normalize.quote** (string) - Optional - Quote currency for normalization (e.g., USD) ### Response #### Success Response (200) - **levels** (double[]) - Alternating [price, liquidationVolume] pairs, ordered ascending by price - **timestamp** (Timestamp) - Snapshot time ``` -------------------------------- ### GET /v1/points Source: https://openmarket.xyz/docs/rest/bitcoin-dominance Retrieves Bitcoin dominance and token supply data for a specified asset. ```APIDOC ## GET /v1/points ### Description Retrieves market-independent token supply data, including market cap, circulating supply, and Bitcoin dominance percentage for a specific asset. ### Method GET ### Endpoint /v1/points ### Parameters #### Query Parameters - **coin** (string) - Required - Asset ticker, for example `BTC`. - **tokenName** (string) - Recommended - Token name, for example `Bitcoin`. Use it together with `coin` to target a single asset cleanly. ### Response #### Success Response (200) - **marketcap** (double) - Current market capitalization - **firstMarketcap** (double) - Baseline market cap used by the source dataset - **marketcapDominancePercent** (double) - Share of total crypto market cap for the requested asset - **circulatingSupply** (double) - Circulating token supply - **totalSupply** (double) - Total token supply - **maxSupply** (double) - Maximum token supply - **totalValueLocked** (double) - Total value locked - **fullyDilutedValuation** (double) - Fully diluted valuation - **chain** (string) - Primary chain identifier - **contractAddress** (string) - Contract address when applicable - **cgMarketcapRank** (int64) - Market cap rank - **totalVolume** (double) - Trading volume from the source dataset - **usdPrice** (double) - Spot price in USD - **timestamp** (Timestamp) - Start of the returned interval bucket ``` -------------------------------- ### Raw trade response format Source: https://openmarket.xyz/docs/ws/trades Example of the data structure returned for individual trade events. ```JSON { "points": [ { "series": { "type": "TRADE", "symbol": "BTCUSDT", "exchange": "BINANCE_FUTURES", "normalizedSymbol": "BTC-USDT", "category": "PERPETUAL", "side": "BUY", "coin": "BTC", "inverse": false }, "trade": { "id": "7126482260", "price": 90003, "amount": 0.002, "timestamp": { "seconds": 1769058875, "nanoseconds": 830000000 } } } ] } ``` -------------------------------- ### Authenticate with OpenMarket Data API Source: https://openmarket.xyz/docs/authentication Examples of including the X-OpenMarket-Key header in API requests across different languages. ```curl curl "https://api.openmarket.xyz/v1/points ?type=TRADE_SIDE_AGNOSTIC_AGG &exchange=BINANCE_FUTURES &rawSymbol=BTCUSDT &interval=HOUR &from=1774800000 &period=3600" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` ```python import requests response = requests.get( "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&rawSymbol=BTCUSDT&interval=HOUR&from=1774800000&period=3600", headers={"X-OpenMarket-Key": "YOUR_API_KEY"} ) data = response.json() ``` ```javascript const response = await fetch( "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&rawSymbol=BTCUSDT&interval=HOUR&from=1774800000&period=3600", { headers: { "X-OpenMarket-Key": "YOUR_API_KEY" } } ) const data = await response.json() ``` -------------------------------- ### GET /v1/points Source: https://openmarket.xyz/docs/quick-examples Retrieves a heatmap of resting take-profit and stop-loss orders by price to visualize conditional flow. ```APIDOC ## GET /v1/points ### Description Retrieves a heatmap of resting take-profit and stop-loss orders by price to visualize conditional flow. ### Method GET ### Endpoint /v1/points ### Query Parameters - **type** (string) - Required - HYPERLIQUID_TRIGGER_LIQUIDITY_AGG - **coin** (string) - Required - BTC - **interval** (string) - Required - MINUTE - **transform.normalize.quote** (string) - Required - USD ``` -------------------------------- ### GET /v1/points Source: https://openmarket.xyz/docs/rest/liquidations Retrieves aggregated liquidation volume across specified exchanges for a given coin, converted to USD. ```APIDOC ## GET /v1/points ### Description Sums liquidation volume across Binance Futures, Bybit, and OKX for all BTC pairs, converted to USD. Useful for tracking total market liquidation pressure. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/points ### Parameters #### Query Parameters - **type** (string) - Required - The data type, e.g., LIQUIDATION_AGG - **exchange** (string) - Required - The exchange name (can be repeated) - **coin** (string) - Required - The coin symbol, e.g., BTC - **interval** (string) - Required - The time interval, e.g., HOUR - **from** (integer) - Required - Start timestamp - **period** (integer) - Required - Duration in seconds - **transform.groupBy.type** (string) - Required - Grouping method - **transform.normalize.quote** (string) - Required - Quote currency for normalization ### Response #### Success Response (200) - **series** (array) - List of liquidation data series #### Response Example { "series": [ { "id": { "type": "LIQUIDATION_AGG", "exchange": "BINANCE_FUTURES", "rawSymbol": "BTCUSDT", "normalizedSymbol": "BTC-USDT", "category": "PERPETUAL", "interval": "HOUR", "side": "SELL", "coin": "BTC" }, "points": [ { "Point": { "liquidations": 0.223, "timestamp": { "s": 1774800000 } } } ] } ] } ``` -------------------------------- ### Inspect a trader workflow Source: https://openmarket.xyz/docs/rest/polymarket-analytics Demonstrates how to retrieve a wallet address from the leaderboard and use it to fetch profile, category, and position data, followed by market context. ```Bash WALLET=$(curl -s "https://api.openmarket.xyz/v1/polymarket/analytics/leaderboard?limit=1" \ -H "X-OpenMarket-Key: YOUR_API_KEY" | jq -r '.traderProfiles[0].wallet_address') curl "https://api.openmarket.xyz/v1/polymarket/analytics/trader-profile?userWallet=${WALLET}" \ -H "X-OpenMarket-Key: YOUR_API_KEY" curl "https://api.openmarket.xyz/v1/polymarket/analytics/user-categories?userWallet=${WALLET}" \ -H "X-OpenMarket-Key: YOUR_API_KEY" CONDITION_ID=$(curl -s "https://api.openmarket.xyz/v1/polymarket/analytics/positions?userWallet=${WALLET}&limit=1" \ -H "X-OpenMarket-Key: YOUR_API_KEY" | jq -r '.userPositions[0].condition_id') curl "https://api.openmarket.xyz/v1/polymarket/analytics/market-summary?conditionId=${CONDITION_ID}" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` -------------------------------- ### Inspect a market workflow Source: https://openmarket.xyz/docs/rest/polymarket-analytics Demonstrates how to retrieve market summary and position data using a known condition ID. ```Bash CONDITION_ID="0xe0658c4beed2102c181b3987edff5edd578ad2952a6eb5fa8018925e5d7a48fd" curl "https://api.openmarket.xyz/v1/polymarket/analytics/market-summary?conditionId=${CONDITION_ID}" \ -H "X-OpenMarket-Key: YOUR_API_KEY" curl "https://api.openmarket.xyz/v1/polymarket/analytics/positions?conditionId=${CONDITION_ID}&limit=5" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` -------------------------------- ### Configure time-range parameters Source: https://openmarket.xyz/docs/best-practices Set the starting timestamp and duration for time-range queries. Both parameters are required to avoid empty results. ```text from=1774800000&period=3600 # 1 hour of data from=1774800000&period=86400 # 1 day of data ``` -------------------------------- ### GET /v1/polymarket/analytics/positions Source: https://openmarket.xyz/docs/rest/polymarket-analytics Retrieves analytics for a specific user's positions on Polymarket. ```APIDOC ## GET /v1/polymarket/analytics/positions ### Description Retrieves a list of analytics for positions held by a specific user wallet on Polymarket. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/polymarket/analytics/positions ### Parameters #### Query Parameters - **userWallet** (string) - Required - The wallet address of the user. - **limit** (integer) - Optional - The number of results to return. ### Response #### Success Response (200) - **userPositions** (array) - List of position analytics objects. #### Response Example { "userPositions": [ { "wallet_address": "0xf1302aafc43aa3a69bcd8058fc7a0259dac246ab", "asset_id": "69984203794322070924779554468751071533998686576952069110752844084141678897886", "realized_size": 11555027.501624001, "avg_exit_price": 0.49675456353732356, "realized_pnl": 5740012.643231001, "resolved_price": 1, "prev_hold_duration": 14305671, "merge_count": 153, "transfer_in_count": 383, "transfer_out_count": 24, "market_name": "Which party will control the U.S. Senate after the 2022 election?", "outcome_name": "Democratic", "category": "Politics", "sub_category": "US Politics", "condition_id": "0xe0658c4beed2102c181b3987edff5edd578ad2952a6eb5fa8018925e5d7a48fd" } ] } ``` -------------------------------- ### Connect and subscribe to trade stream via WebSocket Source: https://openmarket.xyz/docs/quickstart Follow these steps to establish a connection, authenticate with an API key, and subscribe to BTC trade data from Binance Futures. ```WebSocket // 1. Connect wss://ap-sin3.ws.api.openmarket.xyz/nonbook/ws?encoding=json // 2. Authenticate { "method": "public/authenticate", "params": { "token": "YOUR_API_KEY" } } // 3. Subscribe { "jsonrpc": "2.0", "id": 0, "method": "public/subscribe", "params": { "channels": [{ "type": "TRADE", "exchange": "BINANCE_FUTURES", "symbol": "BTCUSDT", "category": "*" }], "compression": "brotli", "version": "v2" } } // 4. Receive { "points": [{ "series": { "type": "TRADE", "side": "BUY", "coin": "BTC", ... }, "trade": { "price": 90003, "amount": 0.002, ... } }] } ``` -------------------------------- ### GET /v1/polymarket/analytics/market-summary Source: https://openmarket.xyz/docs/rest/polymarket-analytics Retrieves a summary of market analytics for a specific asset identified by its assetId. ```APIDOC ## GET /v1/polymarket/analytics/market-summary ### Description Retrieves a comprehensive market summary for a given asset, including open/closed positions, PnL metrics, and outcome pricing. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/polymarket/analytics/market-summary ### Parameters #### Query Parameters - **assetId** (string) - Required - The unique identifier for the asset. ### Request Example curl "https://api.openmarket.xyz/v1/polymarket/analytics/market-summary?assetId=69984203794322070924779554468751071533998686576952069110752844084141678897886" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ### Response #### Success Response (200) - **marketSummary** (object) - The analytical data object for the requested asset. #### Response Example { "marketSummary": { "event_id": "3506", "condition_id": ["0xe0658c4beed2102c181b3987edff5edd578ad2952a6eb5fa8018925e5d7a48fd"], "total_open_positions": 12, "total_closed_positions": 934, "total_cost_basis": 3287751.5362184998, "total_size": 13278317.319730995, "largest_open_position": 6517160.129311998, "total_split_count": 10516, "total_merge_count": 6370, "total_transfer_in_count": 10523, "total_transfer_out_count": 10523, "median_hold_duration": 19340026, "mean_hold_duration": 15813372.224219989, "realized_pnl_min": -7865106.637885602, "realized_pnl_max": 5740012.643231001, "realized_pnl_distribution": [-7865106.637885602, -0.00046407000000012324, 0, 74042.54808002156], "win_rate": 0.5288259958071279, "avg_size": 48280.608293311605, "outcome_pricing": [ { "condition_id": "0xe0658c4beed2102c181b3987edff5edd578ad2952a6eb5fa8018925e5d7a48fd", "token_id": "111299642775108135148113523472260651188510255643046337855221699185339755388694", "outcome_name": "Republican", "weighted_avg_entry_price": 0.000005283318038929714, "weighted_avg_exit_price": 0.1733132532287334, "open_pos_avg_price_distribution": [10, 0, 0, 3], "closed_pos_avg_exit_price_distribution": [872, 1, 2, 24] } ] } } ``` -------------------------------- ### User Categories Response Format Source: https://openmarket.xyz/docs/rest/polymarket-analytics Example JSON response structure containing the wallet address and a list of category-level trading metrics. ```JSON { "userCategories": { "wallet_address": "0xf1302aafc43aa3a69bcd8058fc7a0259dac246ab", "category_breakdown": [ { "market_category": "Politics", "market_sub_category": "US Politics", "count": 248, "realized_size": 114739709.61980493, "realized_pnl": 56646616.73381202 } ] } } ``` -------------------------------- ### GET /tp-sl-heatmap Source: https://openmarket.xyz/docs/rest/tp-sl-heatmap Retrieves a heatmap of TP/SL trigger orders for a specified exchange and symbol. ```APIDOC ## GET /tp-sl-heatmap ### Description Retrieves a snapshot of resting TP/SL trigger orders for a given exchange and symbol, providing price and volume levels. ### Method GET ### Endpoint /tp-sl-heatmap ### Parameters #### Query Parameters - **exchange** (string) - Conditional - HYPERLIQUID_FUTURES for Hyperliquid perpetual trigger liquidity. Combine with rawSymbol. - **rawSymbol** (string) - Conditional - Hyperliquid symbol (e.g., BTC). Pair with exchange. - **coin** (string) - Conditional - Base asset filter. - **maxDepth** (int) - Optional - Maximum number of price levels per side. Default: 1500. - **flatten** (bool) - Optional - When true, returns flat_points instead of points. - **transform.normalize.quote** (Normalize) - Optional - Set to USD for USD-denominated trigger volumes. ### Response #### Success Response (200) - **buy_levels** (double[]) - Alternating [price, triggerVolume] pairs for resting buy-side trigger orders. - **sell_levels** (double[]) - Alternating [price, triggerVolume] pairs for resting sell-side trigger orders. - **timestamp** (Timestamp) - Snapshot time. ``` -------------------------------- ### GET /v1/tenors Source: https://openmarket.xyz/docs/rest/metadata Lists available tenor values for specific option summary types. ```APIDOC ## GET /v1/tenors ### Description List available tenor values for the current filter set. Useful for option summary types such as IMPLIED_VOLATILITY_OPTION_SUMMARY_AGG and SKEW_OPTION_SUMMARY_AGG. ### Method GET ### Endpoint /v1/tenors ### Parameters #### Query Parameters - **type** (string) - Required - The option summary type - **exchange** (string) - Required - The exchange name - **coin** (string) - Required - The coin identifier ### Response #### Success Response (200) - **tenors** (array) - List of available tenor strings #### Response Example { "tenors": ["ONE_W", "ONE_M", "TWO_M", "THREE_M"] } ``` -------------------------------- ### Example API Response Structure Source: https://openmarket.xyz/docs/rest/tp-sl-heatmap The JSON response format containing the series metadata and the flat price-volume level arrays. ```json { "series": [ { "id": { "type": "HYPERLIQUID_TRIGGER_LIQUIDITY_AGG", "exchange": "HYPERLIQUID_FUTURES", "normalizedSymbol": "BTC-USD", "category": "PERPETUAL", "interval": "MINUTE", "coin": "BTC" }, "points": [ { "Point": { "timestamp": { "s": 1777452840 }, "buy_levels": [76830, 5.50015, 76840, 3.55056, 76850, 1.36953, ...], "sell_levels": [77000, 2.41020, 77100, 8.13422, 77200, 12.65331, ...] } } ] } ] } ``` -------------------------------- ### GET /v1/markets Source: https://openmarket.xyz/docs/rest/metadata Retrieves a list of markets, supporting filtering by exchange, sorting, and pagination. ```APIDOC ## GET /v1/markets ### Description Retrieves a list of markets from the OpenMarket API. Supports filtering by exchange, sorting by specific fields, and pagination using offsets. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/markets ### Parameters #### Query Parameters - **exchange** (string) - Required - The exchange identifier (e.g., BINANCE_FUTURES). - **pageSize** (integer) - Optional - Number of results to return per page. - **sortCriteria.field** (string) - Optional - The field to sort by (e.g., VOLUME_24H). - **sortCriteria.direction** (integer) - Optional - The sort direction. - **pageOffset** (integer) - Optional - The offset for pagination. ### Response #### Success Response (200) - **symbols** (array) - List of market entries. - **nextOffset** (integer) - The offset to use for the next page of results. ``` -------------------------------- ### Paginate market results Source: https://openmarket.xyz/docs/rest/metadata Demonstrates how to iterate through pages using the pageOffset parameter. Use the nextOffset value from the previous response to fetch subsequent pages. ```cURL # Page 1 curl "https://api.openmarket.xyz/v1/markets?exchange=BINANCE_FUTURES&pageSize=20&pageOffset=0" \ -H "X-OpenMarket-Key: YOUR_API_KEY" # Page 2 (use nextOffset from previous response) curl "https://api.openmarket.xyz/v1/markets?exchange=BINANCE_FUTURES&pageSize=20&pageOffset=20" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` -------------------------------- ### Query market data by normalized symbol Source: https://openmarket.xyz/docs/exchanges Use these examples to retrieve trade data using a cross-exchange normalized symbol format. ```curl curl "https://api.openmarket.xyz/v1/points ?type=TRADE_SIDE_AGNOSTIC_AGG &exchange=BINANCE_FUTURES &normalizedSymbol=BTC-USDT &interval=HOUR &from=1774800000 &period=3600" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` ```python import requests response = requests.get( "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&normalizedSymbol=BTC-USDT&interval=HOUR&from=1774800000&period=3600 ", headers={"X-OpenMarket-Key": "YOUR_API_KEY"} ) data = response.json() ``` ```javascript const response = await fetch( "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&normalizedSymbol=BTC-USDT&interval=HOUR&from=1774800000&period=3600 ", { headers: { "X-OpenMarket-Key": "YOUR_API_KEY" } } ) const data = await response.json() ``` -------------------------------- ### Volume Profile JSON Response Source: https://openmarket.xyz/docs/ws/volume-profile Example of a JSON response for a volume profile aggregation stream. ```JSON { "points": [ { "series": { "type": "VOLUME_PROFILE_AGG", "symbol": "BTCUSDT", "exchange": "BINANCE_FUTURES", "coin": "BTC", "category": "PERPETUAL", "blockSize": 25 }, "volumeProfileAggregation": { "profile": [ 89950, 1.25, 0.87, 89975, 3.41, 2.15, 90000, 5.67, 4.32, 90025, 2.89, 3.01, 90050, 1.54, 0.92 ], "timestamp": { "seconds": 1769058600 } } } ] } ``` -------------------------------- ### public/subscribe (BLOCK_BOOK_SNAPSHOT) Source: https://openmarket.xyz/docs/ws/orderbook Subscribe to live orderbook snapshots using the JSON-RPC 2.0 protocol over WebSocket. ```APIDOC ## WebSocket Subscription: public/subscribe ### Description Subscribe to live orderbook snapshots bucketed by price level. The server reconstructs the full book from exchange updates and streams aggregated depth. ### Parameters #### Channel Parameters (BLOCK_BOOK_SNAPSHOT) - **blockSize** (string) - Required - Price bucket size. Use the value from GET /v1/block-sizes. - **maxDepth** (string) - Optional - Maximum number of price levels per side. - **groupByType** (string) - Optional - Set to "1" to aggregate across symbols for the same coin. Default: "0". - **updateFrequency** (string) - Optional - Minimum time between snapshots (e.g., 500ms, 1s, 5s). ### Request Example (Per-symbol) { "jsonrpc": "2.0", "id": 0, "method": "public/subscribe", "params": { "channels": [ { "type": "BLOCK_BOOK_SNAPSHOT", "category": "*", "exchange": "BINANCE_FUTURES", "symbol": "BTCUSDT", "blockSize": "25", "maxDepth": "500", "quote": "COIN", "updateFrequency": "1s" } ], "compression": "brotli", "version": "v2" } } ### Request Example (Coin-aggregated) { "jsonrpc": "2.0", "id": 1, "method": "public/subscribe", "params": { "channels": [ { "type": "BLOCK_BOOK_SNAPSHOT", "category": "*", "exchange": "BINANCE_FUTURES", "symbol": "BTC", "blockSize": "25", "maxDepth": "500", "quote": "COIN", "groupByType": "1", "updateFrequency": "1s" } ], "compression": "brotli", "version": "v2" } } ``` -------------------------------- ### Receive Trade Data Payload Source: https://openmarket.xyz/docs/ws/overview Example of the JSON structure returned when receiving trade updates. ```json { "points": [ { "series": { "type": "TRADE", "symbol": "BTCUSDT", "exchange": "BINANCE_FUTURES", "normalizedSymbol": "BTC-USDT", "category": "PERPETUAL", "side": "BUY", "coin": "BTC" }, "trade": { "id": "7126482260", "price": 90003, "amount": 0.002, "timestamp": { "seconds": 1769058875, "nanoseconds": 830000000 } } } ] } ``` -------------------------------- ### Normalize funding rates via API Source: https://openmarket.xyz/docs/exchanges Examples for requesting normalized funding rate data using curl, Python, and JavaScript. ```curl curl "https://api.openmarket.xyz/v1/points ?type=FUNDING_RATE_AGG &exchange=BINANCE_FUTURES &rawSymbol=BTCUSDT &interval=HOUR &from=1774800000 &period=28800 &transform.normalize.fundingInterval=28800000" \ -H "X-OpenMarket-Key: YOUR_API_KEY" ``` ```python import requests response = requests.get( "https://api.openmarket.xyz/v1/points?type=FUNDING_RATE_AGG&exchange=BINANCE_FUTURES&rawSymbol=BTCUSDT&interval=HOUR&from=1774800000&period=28800&transform.normalize.fundingInterval=28800000 ", headers={"X-OpenMarket-Key": "YOUR_API_KEY"} ) data = response.json() ``` ```javascript const response = await fetch( "https://api.openmarket.xyz/v1/points?type=FUNDING_RATE_AGG&exchange=BINANCE_FUTURES&rawSymbol=BTCUSDT&interval=HOUR&from=1774800000&period=28800&transform.normalize.fundingInterval=28800000 ", { headers: { "X-OpenMarket-Key": "YOUR_API_KEY" } } ) const data = await response.json() ``` -------------------------------- ### TPO Aggregation Response Structure Source: https://openmarket.xyz/docs/rest/tpo Example of the JSON response returned by the TPO aggregation endpoint. ```json { "series": [ { "id": { "type": "TPO_AGG", "exchange": "BINANCE_FUTURES", "rawSymbol": "BTCUSDT", "normalizedSymbol": "BTC-USDT", "category": "PERPETUAL", "interval": "FIFTEEN_MINUTES", "coin": "BTC" }, "points": [ { "Point": { "TpoAggregation": { "timestamp": { "s": 1774828800 }, "period_start": { "s": 1774828800 }, "period_end": { "s": 1774886400 }, "levels": [ { "price": 65754, "block_ids": [0], "buy_volume": 10.413000000000006, "sell_volume": 10.654999999999998 } ] } } } ] } ] } ``` -------------------------------- ### API Response Structure Source: https://openmarket.xyz/docs/rest/candles Example JSON response containing the series of aggregated candle points. ```json { "series": [ { "id": { "type": "TRADE_SIDE_AGNOSTIC_AGG", "exchange": "BINANCE_FUTURES", "rawSymbol": "BTCUSDT", "normalizedSymbol": "BTC-USDT", "category": "PERPETUAL", "interval": "HOUR", "coin": "BTC" }, "points": [ { "Point": { "open": 66499.9, "high": 66639.0, "low": 66400.0, "close": 66467.8, "volume": 2852.8330000000055, "timestamp": { "s": 1774800000 }, "firstTimestamp": { "s": 1774800003, "ns": 234000000 }, "lastTimestamp": { "s": 1774803599, "ns": 649000000 } } } ] } ] } ``` -------------------------------- ### GET /v1/polymarket/analytics/positions Source: https://openmarket.xyz/docs/rest/polymarket-analytics Retrieves bounded position rows for a specific wallet, asset, or market condition. ```APIDOC ## GET /v1/polymarket/analytics/positions ### Description Returns bounded position rows for one wallet, one asset, or one market condition. At least one of userWallet, assetId, or conditionId is required. ### Method GET ### Endpoint /v1/polymarket/analytics/positions ### Parameters #### Query Parameters - **userWallet** (string) - Optional - Wallet address. - **assetId** (string) - Optional - Outcome token identifier. Mutually exclusive with conditionId. - **conditionId** (string) - Optional - Market condition identifier. Mutually exclusive with assetId. - **limit** (int32) - Optional - Number of rows to return. Default: 20. Max: 100. - **offset** (int32) - Optional - Zero-based pagination offset. Default: 0. Max: 10000. - **sortBy** (enum) - Optional - LAST_OPEN_TS, REALIZED_PNL, REALIZED_SIZE, AVG_PRICE, or UNREALIZED_SIZE. - **sortDirection** (enum) - Optional - SORT_DIRECTION_ASC or SORT_DIRECTION_DESC. - **positionStatus** (enum) - Optional - OPEN_POSITIONS or CLOSED_POSITIONS. - **openedBefore** (int64) - Optional - Unix seconds. Keeps rows with latest_open_ts < openedBefore. - **openedAfter** (int64) - Optional - Unix seconds. Keeps rows with latest_open_ts > openedAfter. - **minRealizedPnl** (double) - Optional - Minimum realized_pnl. - **maxRealizedPnl** (double) - Optional - Maximum realized_pnl. - **minRealizedSize** (double) - Optional - Minimum realized_size. - **maxRealizedSize** (double) - Optional - Maximum realized_size. - **minUnrealizedSize** (double) - Optional - Minimum unrealized_size. - **maxUnrealizedSize** (double) - Optional - Maximum unrealized_size. - **pnlComponents** (enum, repeated) - Optional - Affects realized_pnl and related filters. ### Response #### Success Response (200) - **wallet_address** (string) - Trader wallet address - **asset_id** (string) - Outcome token identifier - **unrealized_size** (double) - Currently unrealized position size - **realized_size** (double) - Realized position size - **avg_price** (double) - Average entry price - **avg_exit_price** (double) - Average exit price - **realized_pnl** (double) - Realized PnL - **resolved_price** (double) - Final resolved price, when available - **latest_open_ts** (int64) - Latest open timestamp - **prev_hold_duration** (int64) - Previous holding duration in seconds - **buy_count** (int32) - Number of buy events - **sell_count** (int32) - Number of sell events - **split_count** (int32) - Number of split events - **merge_count** (int32) - Number of merge events - **transfer_in_count** (int32) - Number of inbound transfer events - **transfer_out_count** (int32) - Number of outbound transfer events - **conversion_in_count** (int32) - Number of inbound conversion events - **conversion_out_count** (int32) - Number of outbound conversion events - **market_name** (string) - Market title - **outcome_name** (string) - Outcome label - **category** (string) - Market category - **sub_category** (string) - Market sub-category - **condition_id** (string) - Market condition identifier - **order_buy_cost** (double) - Cost basis attributable to order-fill buys - **split_cost** (double) - Cost basis attributable to split events - **pnl_by_source** (object) - Per-event-type PnL breakdown ``` -------------------------------- ### GET /v1/points Source: https://openmarket.xyz/docs/exchanges Retrieves aggregated data across multiple exchanges. Requires the Advanced tier. ```APIDOC ## GET /v1/points ### Description Aggregates data across multiple exchanges into a single series. Use the `coin` parameter instead of `rawSymbol` to ensure consistency across exchanges. ### Method GET ### Endpoint https://api.openmarket.xyz/v1/points ### Parameters #### Query Parameters - **type** (string) - Required - The data type (e.g., TRADE_SIDE_AGNOSTIC_AGG) - **exchange** (string) - Required - The exchange identifier (can be passed multiple times) - **coin** (string) - Required - The coin symbol - **interval** (string) - Required - The time interval (e.g., HOUR) - **from** (integer) - Required - Start timestamp - **period** (integer) - Required - Duration of the period - **transform.groupBy.type** (string) - Required - The aggregation method (e.g., GROUP_BY_TYPE_SUM) ### Request Example curl "https://api.openmarket.xyz/v1/points?type=TRADE_SIDE_AGNOSTIC_AGG&exchange=BINANCE_FUTURES&exchange=BYBIT&exchange=OKEX_SWAP&coin=BTC&interval=HOUR&from=1774800000&period=3600&transform.groupBy.type=GROUP_BY_TYPE_SUM" -H "X-OpenMarket-Key: YOUR_API_KEY" ``` -------------------------------- ### GET /v1/points (4K orderbook heatmap) Source: https://openmarket.xyz/docs/quick-examples Retrieves 1,000 price levels of bid/ask depth for BTCUSDT on Binance Futures. ```APIDOC ## GET /v1/points ### Description 1,000 price levels of bid/ask depth, updated every minute. ### Method GET ### Endpoint /v1/points ### Parameters #### Query Parameters - **type** (string) - Required - BLOCK_BOOK_SNAPSHOT_AGG - **exchange** (string) - Required - BINANCE_FUTURES - **rawSymbol** (string) - Required - BTCUSDT - **maxDepth** (integer) - Required - 1000 ``` -------------------------------- ### Subscribe to Liquidation Events Source: https://openmarket.xyz/docs/ws/liquidations Use this JSON-RPC request to subscribe to live liquidation ticks for a specific symbol and exchange. ```JSON { "jsonrpc": "2.0", "id": 0, "method": "public/subscribe", "params": { "channels": [ { "type": "LIQUIDATION", "category": "*", "exchange": "BINANCE_FUTURES", "symbol": "BTCUSDT" } ], "compression": "brotli", "version": "v2" } } ```