### Quick Start WebSocket Connection and Subscription Example Source: https://pond.dflow.net/prediction-market-metadata-api-reference/websockets/overview A TypeScript example demonstrating how to establish a WebSocket connection, send subscription messages for all prices, trades, and orderbook updates, and handle incoming messages based on the channel. ```typescript const WEBSOCKET_URL = "wss://prediction-markets-api.dflow.net/api/v1/ws"; const ws = new WebSocket(WEBSOCKET_URL); ws.onopen = () => { console.log("Connected to WebSocket"); // Subscribe to all price updates ws.send( JSON.stringify({ type: "subscribe", channel: "prices", all: true, }) ); // Subscribe to all trade updates ws.send( JSON.stringify({ type: "subscribe", channel: "trades", all: true, }) ); // Subscribe to all orderbook updates ws.send( JSON.stringify({ type: "subscribe", channel: "orderbook", all: true, }) ); }; ws.onmessage = (event) => { const message = JSON.parse(event.data); switch (message.channel) { case "prices": console.log("Price update:", message); break; case "trades": console.log("Trade update:", message); break; case "orderbook": console.log("Orderbook update:", message); break; } }; ws.onerror = (error) => { console.error("WebSocket error:", error); }; ws.onclose = () => { console.log("WebSocket connection closed"); }; ``` -------------------------------- ### Get Live Data by Mint Address (OpenAPI) Source: https://pond.dflow.net/prediction-market-metadata-api-reference/live-data/live-data-by-mint Retrieves live data for an event associated with a given market mint address. This endpoint allows filtering by various milestone attributes such as start date, category, competition, source ID, and type. It is designed to return detailed live data for prediction market events. ```yaml openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/live_data/by-mint/{mint_address}: get: tags: - Live Data summary: Get live data by mint address description: >- Looks up the event ticker from a market mint address, then fetches all live data for that event. Supports all milestone filtering options. operationId: live_data_by_mint parameters: - name: mint_address in: path description: Market mint address (ledger or outcome mint) required: true schema: type: string - name: minimumStartDate in: query description: Minimum start date to filter milestones (RFC3339 format) required: false schema: type: string - name: category in: query description: Filter by milestone category required: false schema: type: string - name: competition in: query description: Filter by competition required: false schema: type: string - name: sourceId in: query description: Filter by source ID required: false schema: type: string - name: type in: query description: Filter by milestone type (use 'type' as query param name) required: false schema: type: string responses: '200': description: Live data retrieved successfully content: application/json: schema: {} '400': description: Bad request or invalid mint content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Market not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### Get Markets Source: https://pond.dflow.net/prediction-market-metadata-api-reference/markets/markets Returns a paginated list of all markets available in the prediction market system. ```APIDOC ## GET /markets ### Description Returns a paginated list of all markets. ### Method GET ### Endpoint /markets ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of markets to return per page. - **offset** (integer) - Optional - The number of markets to skip before starting to collect the result set. ### Request Example ``` GET /markets?limit=10&offset=0 ``` ### Response #### Success Response (200) - **markets** (array) - A list of market objects. - **id** (string) - The unique identifier for the market. - **name** (string) - The name of the market. - **description** (string) - A description of the market. - **created_at** (string) - The timestamp when the market was created. - **updated_at** (string) - The timestamp when the market was last updated. #### Response Example ```json { "markets": [ { "id": "market_123", "name": "Will it rain tomorrow?", "description": "A market predicting the likelihood of rain tomorrow.", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:05:00Z" } ] } ``` ``` -------------------------------- ### Get Live Data by Mint Address Source: https://pond.dflow.net/prediction-market-metadata-api-reference/live-data/live-data-by-mint Retrieves live data for a prediction market event using its mint address. Supports filtering by start date, category, competition, source ID, and type. ```APIDOC ## GET /api/v1/live_data/by-mint/{mint_address} ### Description Looks up the event ticker from a market mint address, then fetches all live data for that event. Supports all milestone filtering options. ### Method GET ### Endpoint /api/v1/live_data/by-mint/{mint_address} ### Parameters #### Path Parameters - **mint_address** (string) - Required - Market mint address (ledger or outcome mint) #### Query Parameters - **minimumStartDate** (string) - Optional - Minimum start date to filter milestones (RFC3339 format) - **category** (string) - Optional - Filter by milestone category - **competition** (string) - Optional - Filter by competition - **sourceId** (string) - Optional - Filter by source ID - **type** (string) - Optional - Filter by milestone type (use 'type' as query param name) ### Request Example ```json { "example": "No request body for GET requests" } ``` ### Response #### Success Response (200) - **(object)** - Live data retrieved successfully #### Error Response (400, 404) - **ErrorResponse** (object) - Bad request or invalid mint / Market not found - **code** (string) - Error code - **msg** (string) - Error message #### Response Example ```json { "example": "[Schema for success response not provided in OpenAPI spec]" } ``` ``` -------------------------------- ### Get Live Data by Event Ticker (OpenAPI) Source: https://pond.dflow.net/prediction-market-metadata-api-reference/live-data/live-data-by-event This OpenAPI definition describes the GET request to retrieve live data for an event. It specifies the path parameter 'event_ticker' and various optional query parameters like 'minimumStartDate', 'category', 'competition', 'sourceId', and 'type' for filtering milestones. The response includes a 200 OK for successful retrieval and a 400 Bad Request for errors. ```yaml GET /api/v1/live_data/by-event/{event_ticker} openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/live_data/by-event/{event_ticker}: get: tags: - Live Data summary: Get live data by event ticker description: >- Fetches all live data for an event by automatically looking up all related milestones and batching the live data requests. Supports all milestone filtering options. operationId: live_data_by_event parameters: - name: event_ticker in: path description: Event ticker required: true schema: type: string - name: minimumStartDate in: query description: Minimum start date to filter milestones (RFC3339 format) required: false schema: type: string - name: category in: query description: Filter by milestone category required: false schema: type: string - name: competition in: query description: Filter by competition required: false schema: type: string - name: sourceId in: query description: Filter by source ID required: false schema: type: string - name: type in: query description: Filter by milestone type (use 'type' as query param name) required: false schema: type: string responses: '200': description: Live data retrieved successfully content: application/json: schema: {} '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### Get Trades by Mint Address (OpenAPI) Source: https://pond.dflow.net/prediction-market-metadata-api-reference/trades/trades-by-mint This OpenAPI definition describes the `GET /api/v1/trades/by-mint/{mint_address}` endpoint. It allows fetching a paginated list of trades for a given market mint address and supports filtering by timestamp. Requires an 'x-api-key' in the header for authentication. ```yaml GET /api/v1/trades/by-mint/{mint_address} openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/trades/by-mint/{mint_address}: get: tags: - Trades summary: Get list of trades for a market by mint address description: >- Looks up the market ticker from a mint address, then fetches trades from Kalshi. Returns a paginated list of trades. Can be filtered by timestamp range. operationId: trades_by_mint parameters: - name: mint_address in: path description: Mint address (ledger or outcome mint) required: true schema: type: string - name: limit in: query description: Maximum number of trades to return (1-1000, default 100) required: false schema: type: integer format: int32 minimum: 0 - name: cursor in: query description: Pagination cursor (trade ID) to start from required: false schema: type: string - name: minTs in: query description: Filter trades after this Unix timestamp required: false schema: type: integer format: int64 minimum: 0 - name: maxTs in: query description: Filter trades before this Unix timestamp required: false schema: type: integer format: int64 minimum: 0 responses: '200': description: List of trades content: application/json: schema: $ref: '#/components/schemas/MultiTradeResponse' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Market not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: MultiTradeResponse: type: object required: - trades properties: cursor: type: - string - 'null' trades: type: array items: $ref: '#/components/schemas/SingleTradeResponse' ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string SingleTradeResponse: type: object required: - tradeId - ticker - price - count - yesPrice - noPrice - yesPriceDollars - noPriceDollars - takerSide - createdTime properties: count: type: integer format: int32 minimum: 0 createdTime: type: integer format: int64 minimum: 0 noPrice: type: integer format: int32 minimum: 0 noPriceDollars: type: string price: type: integer format: int32 minimum: 0 takerSide: type: string ticker: type: string tradeId: type: string yesPrice: type: integer format: int32 minimum: 0 yesPriceDollars: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### Live Data API Source: https://pond.dflow.net/prediction-market-metadata-api-reference/introduction Get live data from Kalshi for milestones and events using the Prediction Market Metadata API. ```APIDOC ## Live Data API Endpoints ### Description Get live data from Kalshi for milestones and events. ### Method GET ### Endpoint /live-data/live-data ### Parameters #### Query Parameters - **event_id** (string) - Optional - Filter live data for a specific event. - **market_id** (string) - Optional - Filter live data for a specific market. ### Request Example ```json { "example": "GET /live-data/live-data?event_id=evt_abc123" } ``` ### Response #### Success Response (200) - **live_data** (array) - An array of live data points. - **market_id** (string) - The ID of the market. - **last_price** (number) - The last traded price. - **volume** (integer) - The total volume traded. - **timestamp** (string) - The timestamp of the data update. #### Response Example ```json { "example": { "live_data": [ { "market_id": "mkt_xyz789", "last_price": 0.76, "volume": 500, "timestamp": "2023-10-27T12:00:00Z" } ] } } ``` ``` -------------------------------- ### Get Market Candlesticks by Mint Address (OpenAPI) Source: https://pond.dflow.net/prediction-market-metadata-api-reference/markets/market-candlesticks-by-mint This OpenAPI definition describes the 'Get Market Candlesticks by Mint' endpoint. It allows you to retrieve market candlestick data by specifying a mint address, start and end timestamps, and a period interval. The endpoint supports responses for successful retrieval (200 OK) and error conditions (400 Bad Request, 404 Not Found). ```yaml GET /api/v1/market/by-mint/{mint_address}/candlesticks openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/market/by-mint/{mint_address}/candlesticks: get: tags: - Candlesticks summary: Get market candlesticks by mint address description: |- Looks up the market ticker from a mint address, then fetches market candlesticks. Automatically resolves the series_ticker. operationId: market_candlesticks_by_mint parameters: - name: mint_address in: path description: Market mint address (ledger or outcome mint) required: true schema: type: string - name: startTs in: query description: Start timestamp (Unix timestamp) required: true schema: type: integer format: int64 minimum: 0 - name: endTs in: query description: End timestamp (Unix timestamp) required: true schema: type: integer format: int64 minimum: 0 - name: periodInterval in: query description: Time period length of each candlestick in minutes (1, 60, or 1440) required: true schema: type: integer format: int32 minimum: 0 responses: '200': description: Market candlesticks retrieved successfully content: application/json: schema: {} '400': description: Bad request or invalid mint content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Market not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### GET /api/v1/markets Source: https://pond.dflow.net/prediction-market-metadata-api-reference/markets/markets Retrieves a paginated list of all markets. This endpoint can be filtered by initialization status, market status, and sorted by various fields. ```APIDOC ## GET /api/v1/markets ### Description Returns a paginated list of all markets. This endpoint can be filtered by initialization status, market status, and sorted by various fields. ### Method GET ### Endpoint /api/v1/markets ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of markets to return. Minimum value is 0. - **cursor** (integer) - Optional - Pagination offset (number of markets to skip). Minimum value is 0. - **isInitialized** (boolean) - Optional - Filter markets that are initialized (have a corresponding market ledger). - **status** (string) - Optional - Filter markets by status. Available options: initialized, active, inactive, closed, determined. - **sort** (string) - Optional - Sort field. Available options: volume, volume24h, liquidity, openInterest, startDate. - **order** (string) - Optional - Sort order. Available options: asc, desc. ### Response #### Success Response (200) - **cursor** (integer | null) - Pagination cursor. - **markets** (array) - An array of market objects. Each object contains details about a single market, including ticker, eventTicker, marketType, titles, times, status, volume, result, openInterest, and more. #### Error Response (400) - **code** (string) - Error code. - **msg** (string) - Error message. ``` -------------------------------- ### Get Events Source: https://pond.dflow.net/prediction-market-metadata-api-reference/events/events Retrieves a paginated list of all events. Optionally, nested markets can be included. ```APIDOC ## GET /events ### Description Returns a paginated list of all events. Can optionally include nested markets. ### Method GET ### Endpoint /events ### Parameters #### Query Parameters - **include_markets** (boolean) - Optional - Whether to include nested markets in the response. ### Response #### Success Response (200) - **events** (array) - A list of event objects. - **id** (string) - The unique identifier for the event. - **name** (string) - The name of the event. - **markets** (array) - A list of market objects associated with the event (if include_markets is true). - **id** (string) - The unique identifier for the market. - **name** (string) - The name of the market. #### Response Example ```json { "events": [ { "id": "event-123", "name": "Upcoming Election", "markets": [ { "id": "market-456", "name": "Will Candidate X win?" } ] } ] } ``` ``` -------------------------------- ### Get Market by ID (OpenAPI) Source: https://pond.dflow.net/prediction-market-metadata-api-reference/markets/market This snippet defines the OpenAPI 3.1.0 specification for retrieving a single market by its `market_id`. It outlines the request method (GET), path parameters, expected responses (200 for success, 400 for errors), and the schema for market and error responses. Authentication is handled via an API key. ```yaml GET /api/v1/market/{market_id} openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/market/{market_id}: get: tags: - Markets summary: Get a specific market by ticker description: Returns a single market by its ticker. operationId: market parameters: - name: market_id in: path description: Market ticker ID required: true schema: type: string responses: '200': description: Single market content: application/json: schema: $ref: '#/components/schemas/SingleMarketResponse' '400': description: Market not found or bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: SingleMarketResponse: type: object required: - ticker - eventTicker - marketType - title - subtitle - yesSubTitle - noSubTitle - openTime - closeTime - expirationTime - status - volume - result - openInterest - canCloseEarly - rulesPrimary - accounts properties: accounts: type: object additionalProperties: $ref: '#/components/schemas/MarketAccountInfo' propertyNames: type: string canCloseEarly: type: boolean closeTime: type: integer format: int64 minimum: 0 earlyCloseCondition: type: - string - 'null' eventTicker: type: string expirationTime: type: integer format: int64 minimum: 0 marketType: type: string noAsk: type: - string - 'null' noBid: type: - string - 'null' noSubTitle: type: string openInterest: type: integer format: int64 minimum: 0 openTime: type: integer format: int64 minimum: 0 result: type: string rulesPrimary: type: string rulesSecondary: type: - string - 'null' status: type: string subtitle: type: string ticker: type: string title: type: string volume: type: integer format: int64 minimum: 0 yesAsk: type: - string - 'null' yesBid: type: - string - 'null' yesSubTitle: type: string ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string MarketAccountInfo: type: object required: - marketLedger - yesMint - noMint - isInitialized properties: isInitialized: type: boolean marketLedger: type: string noMint: type: string redemptionStatus: type: - string - 'null' scalarOutcomePct: type: - integer - 'null' format: int32 minimum: 0 yesMint: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### Get Live Data from Kalshi API - OpenAPI Specification Source: https://pond.dflow.net/prediction-market-metadata-api-reference/live-data/live-data This OpenAPI 3.1.0 specification defines the 'live_data' GET endpoint. It allows fetching live data from the Kalshi API for specified milestone IDs. The endpoint requires an API key for authentication and returns live data or an error response. ```yaml openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/live_data: get: tags: - Live Data summary: Get live data from Kalshi description: |- Relays live data from the Kalshi API for one or more milestones. This endpoint passes through the response directly from Kalshi. operationId: live_data parameters: - name: milestoneIds in: query description: Array of milestone IDs (max 100) required: true schema: type: array items: type: string responses: '200': description: Live data retrieved successfully content: application/json: schema: {} '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### Get Live Data by Event Source: https://pond.dflow.net/prediction-market-metadata-api-reference/live-data/live-data-by-event Fetches all live data for an event by automatically looking up all related milestones and batching the live data requests. Supports all milestone filtering options. ```APIDOC ## GET /api/v1/live_data/by-event/{event_ticker} ### Description Fetches all live data for an event by automatically looking up all related milestones and batching the live data requests. Supports all milestone filtering options. ### Method GET ### Endpoint /api/v1/live_data/by-event/{event_ticker} ### Parameters #### Path Parameters - **event_ticker** (string) - Required - Event ticker #### Query Parameters - **minimumStartDate** (string) - Optional - Minimum start date to filter milestones (RFC3339 format) - **category** (string) - Optional - Filter by milestone category - **competition** (string) - Optional - Filter by competition - **sourceId** (string) - Optional - Filter by source ID - **type** (string) - Optional - Filter by milestone type (use 'type' as query param name) ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **Live data retrieved successfully** (object) - Description of the live data fields would go here if schema was provided. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /api/v1/events Source: https://pond.dflow.net/prediction-market-metadata-api-reference/events/events Retrieves a paginated list of all events. This endpoint can optionally include nested markets for each event. ```APIDOC ## GET /api/v1/events ### Description Returns a paginated list of all events. Can optionally include nested markets. ### Method GET ### Endpoint /api/v1/events ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of events to return. Minimum value is 0. - **withNestedMarkets** (boolean) - Optional - Include nested markets in response. - **cursor** (integer) - Optional - Pagination offset (number of events to skip). Minimum value is 0. - **seriesTickers** (string) - Optional - Filter by series tickers (comma-separated list, max 25). - **isInitialized** (boolean) - Optional - Filter events that are initialized (have a corresponding market ledger). - **status** (string) - Optional - Filter events by market status. Available options: initialized, active, inactive, closed, determined. - **sort** (SortField) - Optional - Sort field. Available options: volume, volume24h, liquidity, openInterest, startDate. - **order** (string) - Optional - Sort order. Available options: asc, desc. ### Response #### Success Response (200) - **cursor** (integer | null) - Pagination offset. - **events** (array) - List of events. - **ticker** (string) - Event ticker. - **seriesTicker** (string) - Series ticker. - **title** (string) - Event title. - **subtitle** (string) - Event subtitle. - **competition** (string | null) - Event competition. - **competitionScope** (string | null) - Competition scope. - **imageUrl** (string | null) - Image URL for the event. - **liquidity** (integer | null) - Event liquidity. - **openInterest** (integer | null) - Event open interest. - **settlementSources** (array | null) - Settlement sources for the event. - **markets** (array | null) - Nested markets for the event. - (Schema refers to SingleMarketResponse, not fully defined in provided text) #### Error Response (400) - **code** (string) - Error code. - **msg** (string) - Error message. ### Response Example ```json { "cursor": 100, "events": [ { "ticker": "event-1", "seriesTicker": "series-1", "title": "Example Event 1", "subtitle": "An example event", "competition": "Football", "competitionScope": "World Cup", "imageUrl": "http://example.com/image.jpg", "liquidity": 10000, "openInterest": 5000, "settlementSources": ["source1"], "markets": [ { "ticker": "market-1", "seriesTicker": "series-1", "title": "Market 1 Title", "outcome": "Yes", "shortDescription": "Short description for market 1", "status": "active", "creationDate": "2023-10-27T10:00:00Z", "lastUpdatedDate": "2023-10-27T11:00:00Z", "volume": 5000, "volume24h": 1000, "openInterest": 2000, "pool": { "totalAmount": 10000, "YES_amount": 7000, "NO_amount": 3000 }, "lastPriceTraded": 0.7, "bestBuyYesCost": 0.75, "bestSellYesCost": 0.7, "bestBuyNoCost": 0.25, "bestSellNoCost": 0.3, "totalShares": { "totalAmount": 10000, "YES_amount": 7000, "NO_amount": 3000 }, "totalBonds": { "totalAmount": 10000, "YES_amount": 7000, "NO_amount": 3000 } } ] } ] } ``` ``` -------------------------------- ### Series API Source: https://pond.dflow.net/prediction-market-metadata-api-reference/introduction Get series templates for recurring events via the Prediction Market Metadata API. ```APIDOC ## Series API Endpoints ### Description Get series templates for recurring events. ### Method GET ### Endpoint /series/series ### Parameters #### Query Parameters - **category** (string) - Optional - Filter series by category. ### Request Example ```json { "example": "GET /series/series?category=politics" } ``` ### Response #### Success Response (200) - **series** (array) - A list of series templates. - **id** (string) - The unique identifier for the series. - **title** (string) - The title of the series. - **category** (string) - The category of the series. #### Response Example ```json { "example": { "series": [ { "id": "ser_pqr123", "title": "US Election Series", "category": "politics" } ] } } ``` ``` -------------------------------- ### Get Event Candlesticks OpenAPI Specification Source: https://pond.dflow.net/prediction-market-metadata-api-reference/events/event-candlesticks OpenAPI 3.1.0 specification for the 'Get event candlesticks by ticker' endpoint. This endpoint retrieves event candlesticks from the Kalshi API, automatically resolving the series_ticker from the event ticker. It requires the event ticker, start and end timestamps, and a period interval. ```yaml openapi: 3.1.0 info: title: prediction-markets-api description: API for prediction markets license: name: '' version: 0.1.0 servers: - url: https://prediction-markets-api.dflow.net security: - api_key: [] tags: - name: Candlesticks description: Market and event candlesticks relay endpoints - name: Events description: Event management endpoints - name: Markets description: Market management endpoints - name: Trades description: Trade history endpoints - name: Series description: Series template endpoints - name: Tags description: Tag and category endpoints - name: Sports description: Sports filtering endpoints - name: Live Data description: Live data relay endpoints - name: Orderbook description: Orderbook endpoints - name: Search description: Full-text search endpoints paths: /api/v1/event/{ticker}/candlesticks: get: tags: - Candlesticks summary: Get event candlesticks by ticker description: >- Relays event candlesticks from the Kalshi API. Automatically resolves the series_ticker from the event ticker. This endpoint passes through the response directly from Kalshi. operationId: event_candlesticks parameters: - name: ticker in: path description: Event ticker required: true schema: type: string - name: startTs in: query description: Start timestamp (Unix timestamp) required: true schema: type: integer format: int64 minimum: 0 - name: endTs in: query description: End timestamp (Unix timestamp) required: true schema: type: integer format: int64 minimum: 0 - name: periodInterval in: query description: Time period length of each candlestick in minutes (1, 60, or 1440) required: true schema: type: integer format: int32 minimum: 0 responses: '200': description: Event candlesticks retrieved successfully content: application/json: schema: {} '400': description: Bad request or invalid parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Event not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: ErrorResponse: type: object required: - msg - code properties: code: type: string msg: type: string securitySchemes: api_key: type: apiKey in: header name: x-api-key description: >- API key for authentication. Contact hello@dflow.net to obtain an API key. ``` -------------------------------- ### Get Markets Batch Source: https://pond.dflow.net/prediction-market-metadata-api-reference/markets/markets-batch Retrieves multiple markets by looking up a list of tickers and/or mint addresses. The results are capped at 100 markets maximum. ```APIDOC ## GET /markets/batch ### Description Returns multiple markets by looking up a list of tickers and/or mint addresses. The results are capped at 100 markets maximum. ### Method GET ### Endpoint /markets/batch ### Parameters #### Query Parameters - **ticker** (string) - Optional - A ticker symbol for a market. - **mint_address** (string) - Optional - A mint address for a market. ### Request Example ``` GET /markets/batch?ticker=AAPL&ticker=GOOG ``` GET /markets/batch?mint_address=0x123abc&mint_address=0x456def ### Response #### Success Response (200) - **markets** (array) - An array of market objects. - **ticker** (string) - The ticker symbol for the market. - **mint_address** (string) - The mint address for the market. - **name** (string) - The name of the market. - **description** (string) - A description of the market. - **exchange** (string) - The exchange where the market is listed. - **last_price** (number) - The last traded price for the market. - **price_change_percent** (number) - The percentage change in price for the market. - **volume** (number) - The trading volume for the market. #### Response Example ```json { "markets": [ { "ticker": "AAPL", "mint_address": "0x123abc", "name": "Apple Inc.", "description": "Technology company", "exchange": "NASDAQ", "last_price": 170.50, "price_change_percent": 1.25, "volume": 10000000 }, { "ticker": "GOOG", "mint_address": "0x456def", "name": "Alphabet Inc.", "description": "Internet services", "exchange": "NASDAQ", "last_price": 2800.00, "price_change_percent": -0.50, "volume": 5000000 } ] } ``` ```