{"uid":"cap_-lLdClTrNTUON_MdTOfyY","slug":"api-nansen-ai-109e4695","name":"Nansen Prediction Market OHLCV Candles","description":"Get Prediction Market OHLCV Candles","url":"https://api.nansen.ai/api/v1/prediction-market/ohlcv","method":"GET","headers":{},"bodySchema":{"type":"object","title":"OhlcvRequest","required":["market_id"],"properties":{"date":{"anyOf":[{"type":"object","title":"DateRange","properties":{"to":{"anyOf":[{"type":"string"}],"title":"To","examples":["2025-01-31T23:59:59Z"],"description":"End date in ISO 8601 format (e.g., 2025-01-31T23:59:59Z or 2025-01-31)"},"from":{"anyOf":[{"type":"string"}],"title":"From","examples":["2025-01-01T00:00:00Z"],"description":"Start date in ISO 8601 format (e.g., 2025-01-01T00:00:00Z or 2025-01-01)"}},"description":"Date range model matching the API schema."}],"examples":[{"to":"2024-12-31T23:59:59Z","from":"2024-01-01T00:00:00Z"}],"description":"Date range filter (ISO 8601 date-time)"},"sort":{"anyOf":[{"type":"array","items":{"type":"object","title":"SortOrder[OhlcvSortField]","required":["field","direction"],"properties":{"field":{"enum":["period_start","volume_usd","trade_count"],"type":"string","title":"OhlcvSortField","description":"Sortable fields for OHLCV endpoint."},"direction":{"enum":["ASC","DESC"],"type":"string","title":"SortDirection","description":"Enum for sort directions."}}}}],"title":"Sort","description":"Deprecated: use 'order_by' instead."},"order_by":{"anyOf":[{"type":"array","items":{"type":"object","title":"SortOrder[OhlcvSortField]","required":["field","direction"],"properties":{"field":{"enum":["period_start","volume_usd","trade_count"],"type":"string","title":"OhlcvSortField","description":"Sortable fields for OHLCV endpoint."},"direction":{"enum":["ASC","DESC"],"type":"string","title":"SortDirection","description":"Enum for sort directions."}}}}],"title":"Order By","examples":[[{"field":"period_start","direction":"DESC"}]],"description":"Sort order"},"market_id":{"type":"string","title":"Market Id","examples":["654412"],"maxLength":100,"minLength":1,"description":"Polymarket market ID"},"pagination":{"type":"object","title":"PaginationRequest","properties":{"page":{"type":"integer","title":"Page","default":1,"minimum":1,"description":"Page number (1-based)"},"per_page":{"type":"integer","title":"Per Page","default":10,"maximum":1000,"minimum":1,"description":"Number of records per page (max 1000)"}},"description":"Pagination parameters for API requests."}},"description":"Request for OHLCV endpoint.","additionalProperties":false},"responseSchema":{"type":"object","title":"OhlcvResponse","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","title":"OhlcvCandle","required":["market_id"],"properties":{"low":{"anyOf":[{"type":"number"}],"title":"Low","examples":[0.48],"description":"Low price"},"high":{"anyOf":[{"type":"number"}],"title":"High","examples":[0.55],"description":"High price"},"open":{"anyOf":[{"type":"number"}],"title":"Open","examples":[0.5],"description":"Open price"},"side":{"anyOf":[{"type":"string"}],"title":"Side","examples":["Yes"],"description":"Side label (Yes/No)"},"close":{"anyOf":[{"type":"number"}],"title":"Close","examples":[0.53],"description":"Close price"},"token_id":{"anyOf":[{"type":"string"}],"title":"Token Id","examples":["71321045679252212"],"description":"CLOB token ID"},"market_id":{"type":"string","title":"Market Id","examples":["654412"],"description":"Market ID"},"volume_usd":{"anyOf":[{"type":"number"}],"title":"Volume Usd","examples":[12500],"description":"Volume in USD"},"trade_count":{"anyOf":[{"type":"integer"}],"title":"Trade Count","examples":[150],"description":"Number of trades"},"period_start":{"anyOf":[{"type":"string","format":"date-time"}],"title":"Period Start","examples":["2024-11-01T00:00:00"],"description":"Candle period start (ISO format)"},"outcome_index":{"anyOf":[{"type":"integer"}],"title":"Outcome Index","examples":[1],"description":"Outcome index (1/2)"},"unique_traders":{"anyOf":[{"type":"integer"}],"title":"Unique Traders","examples":[25],"description":"Unique traders in period"}},"description":"OHLCV candle data from ch_api_pm_ohlcv."},"title":"Data","description":"List of OHLCV candle records"},"pagination":{"type":"object","title":"PaginationInfo","properties":{"page":{"type":"integer","title":"Page","default":1,"minimum":1,"description":"Current page number"},"per_page":{"type":"integer","title":"Per Page","default":10,"maximum":1000,"minimum":1,"description":"Number of records per page"},"is_last_page":{"type":"boolean","title":"Is Last Page","default":true,"description":"Whether this is the last page"}},"description":"Pagination information for API responses."}},"description":"Response for OHLCV endpoint."},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mZp7TfeMRpgilqxD0NI1u","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Retrieves OHLCV (open, high, low, close, volume) candlestick price data for prediction market contracts","exampleAgentPrompt":"Pull the OHLCV candlestick data for the Polymarket contract at address 0xabc123 on daily intervals for the past 30 days so I can see how the price and volume moved over time.","exampleUseCases":null,"resultDescription":"Returns an array of OHLCV candlestick records for the specified prediction market, each containing open, high, low, close prices and trading volume over the requested time intervals, enabling chart rendering and price trend analysis.","failureModes":["Invalid or unrecognized market contract address returns 404 or empty result","Unsupported time interval parameter returns validation error","Date range too large may result in timeout or rate limit error","Market not indexed by Nansen returns empty dataset","Malformed POST body returns 400 bad request"],"whenToPreferThis":"Choose this endpoint when you need structured candlestick (OHLCV) price and volume history for prediction market contracts, especially Polymarket positions, and want Nansen's on-chain smart money analytics context rather than raw DEX data. Ideal for charting, backtesting, or analyzing market sentiment over time.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:54:03.279Z","isFirstParty":false}