Returns OHLC candles for the requested market and period. Same param/response shape as GET /2/market/ohlcv-history and GET /2/token/ohlcv-history, so a single client can render both spot and perp charts. Market identifier is dex + market (perp has no pool address). Market mappings are cached server-side for 5 minutes.
Timestamps accept seconds, milliseconds, or ISO date strings — milliseconds are auto-detected for numeric values above 1e12.
Query Parameters
string
required
Upstream DEX to query. One of gains, lighter.
string
required
Human-readable pair in BASE/QUOTE format (e.g., BTC/USD, ETH/USD, USD/JPY). Case-insensitive — internally uppercased.
Lighter: only USD-quoted perps (e.g., BTC/USD, SOL/USD, HYPE/USD).
Gains: crypto, forex, stocks, and commodities. Quote can be non-USD (e.g., USD/JPY, EUR/CHF).
A 404 is returned with example pair names when the market is not found for the chosen DEX.
string
default:"5m"
Candle width. One of 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w.
number | string
Range start (inclusive). UNIX seconds, UNIX milliseconds, or ISO date string.
number | string
Range end (inclusive). Same unit handling as from. Must be greater than from.
number
Max number of candles to return (capped at 2000). When the range yields more candles than amount, only the most recent amount are returned.
Response
array
OHLC candles sorted ascending by t. Duplicate timestamps and rows with h < l or non-finite values are dropped.
Show candle
number
UNIX seconds.
number
Opening price.
number
Highest price in the interval.
number
Lowest price in the interval.
number
Closing price.
Examples
Lighter BTC/USD, 1-minute candles for the last hour:
Market not found for the selected DEX (errors[0] lists example pairs)
unknown market "<market>" for dex "<dex>"
502
Upstream DEX returned an error (timeout, non-200, or code !== 200 for Lighter)
upstream <dex> error
500
Unexpected internal error
internal server error
Notes
Candle shape matches spot OHLCV endpoints ({t, o, h, l, c}). Perp has no v field — volume is not reported by the upstream DEXes.
Empty result sets are not errors — data: [] with HTTP 200 is returned when the upstream has no data for the range.
Market mappings (Gains pairs, Lighter orderBookDetails) are fetched lazily on first request per process and cached for 5 minutes.
Upstream requests have a 10s timeout.
Each request is traced server-side with a short traceId included in every log line for that request.
Query Parameters
dex
enum<string>
required
Upstream DEX to query.
Available options:
gains,
lighter
market
string
required
Human-readable pair in BASE/QUOTE format (e.g., BTC/USD, ETH/USD, USD/JPY). Case-insensitive — internally uppercased. Lighter only supports USD-quoted perps; Gains supports crypto, forex, stocks and commodities (quote may be non-USD).
period
enum<string>
Candle width.
Available options:
1m,
5m,
15m,
30m,
1h,
4h,
1d,
1w
from
numberstring
Range start (inclusive). UNIX seconds, UNIX milliseconds, or ISO date string.
to
numberstring
Range end (inclusive). Same unit handling as from. Must be greater than from.
amount
number
Max number of candles to return (capped at 2000). When the range yields more candles than amount, only the most recent amount are returned.
Response
Perp OHLCV history response. Candles sorted ascending by t. Duplicate timestamps and rows with h < l or non-finite values are dropped. Empty result sets are not errors — data: [] with HTTP 200 is returned when the upstream has no data for the range.
data
object[]
required
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Mobula API","colors":{"primary":"#5C7DF9","light":"#5C7DF9","dark":"#000000"},"logo":{"light":"https://mintcdn.com/mobulalabs/i4_lXsPzQR8eheLT/images/logo/light-logo.svg?fit=max\u0026auto=format\u0026n=i4_lXsPzQR8eheLT\u0026q=85\u0026s=f5099f8a6b3dd6665a32fe40d9288d81","dark":"https://mintcdn.com/mobulalabs/i4_lXsPzQR8eheLT/images/logo/dark-logo.svg?fit=max\u0026auto=format\u0026n=i4_lXsPzQR8eheLT\u0026q=85\u0026s=b1e6703d769cfe27914c2db40b46b332"},"favicon":"https://mintlify.s3.us-west-1.amazonaws.com/mobulalabs/favicon.png","api":{"openapi":["rest-api-reference/openapi.yaml"],"asyncapi":["asyncapi.yaml"]},"background":{"color":{"light":"#f5f5f5","dark":"#111524"}},"navbar":{"links":[{"href":"https://admin.mobula.io","label":"Generate free API key"}],"primary":{"type":"button","label":"Dashboard","href":"https://admin.mobula.io"}},"footer":{"socials":{"twitter":"https://x.com/mobulaio","telegram":"https://t.me/mobuladevelopers"}},"integrations":{"mixpanel":{"projectToken":"792afbf66aa630430016bdbd59c52ba7"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mobulalabs","hasAudioNarration":false,"actualSubdomain":"mobulalabs","customDomains":["docs.mobula.io"],"gitSource":{"type":"github","owner":"fomo-family","repo":"mobula-monorepo","deployBranch":"dev","contentDirectory":"docs/mobula-api-docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10a22c9ffae5051c3f8beb"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b06f5c9c90834d233c7c690","clientVersion":"0.0.4424","searchFilterCounts":[{"language":"default","tag":"Changelog","count":105},{"language":"default","tag":"2026","count":103},{"language":"default","tag":"Chains","count":97},{"language":"default","tag":"Supported Chains","count":96},{"language":"default","tag":"Overview","count":80},{"language":"default","tag":"Data","count":70},{"language":"default","tag":"Guides","count":67},{"language":"default","tag":"Spot","count":51},{"language":"default","tag":"Streams","count":46},{"language":"default","tag":"Perps","count":26}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false,"authValue":{"auth":{}}},"customCss":[{"filePath":"custom.css","content":"img[src*=\"util-badge\"]{width:32px;height:16px;min-width:32px;min-height:16px}"}]}
{"page":{"pagePath":"rest-api-reference/endpoint/perp-chart","slug":"/rest-api-reference/endpoint/perp-chart","pageMetadata":{"public":true,"title":"Get Perp OHLCV History","openapi":"GET /2/perp/ohlcv-history","description":"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.","href":"/rest-api-reference/endpoint/perp-chart"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,ResponseField,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Returns OHLC candles for the requested market and period. Same param/response shape as `,_jsx(_components.code,{children:`GET /2/market/ohlcv-history`}),` and `,_jsx(_components.code,{children:`GET /2/token/ohlcv-history`}),`, so a single client can render both spot and perp charts. Market identifier is `,_jsx(_components.code,{children:`dex`}),` + `,_jsx(_components.code,{children:`market`}),` (perp has no pool address). Market mappings are cached server-side for 5 minutes.`]}),`\n`,_jsxs(Tip,{children:[`Timestamps accept `,_jsx(_components.strong,{children:`seconds, milliseconds, or ISO date strings`}),` — milliseconds are auto-detected for numeric values above `,_jsx(_components.code,{children:`1e12`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`query-parameters`,children:`Query Parameters`}),`\n`,_jsx(ParamField,{query:`dex`,type:`string`,required:true,id:`param-dex`,children:_jsxs(_components.p,{children:[`Upstream DEX to query. One of `,_jsx(_components.code,{children:`gains`}),`, `,_jsx(_components.code,{children:`lighter`}),`.`]})}),`\n`,_jsxs(ParamField,{query:`market`,type:`string`,required:true,id:`param-market`,children:[_jsxs(_components.p,{children:[`Human-readable pair in `,_jsx(_components.code,{children:`BASE/QUOTE`}),` format (e.g., `,_jsx(_components.code,{children:`BTC/USD`}),`, `,_jsx(_components.code,{children:`ETH/USD`}),`, `,_jsx(_components.code,{children:`USD/JPY`}),`). Case-insensitive — internally uppercased.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Lighter`}),`: only USD-quoted perps (e.g., `,_jsx(_components.code,{children:`BTC/USD`}),`, `,_jsx(_components.code,{children:`SOL/USD`}),`, `,_jsx(_components.code,{children:`HYPE/USD`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Gains`}),`: crypto, forex, stocks, and commodities. Quote can be non-USD (e.g., `,_jsx(_components.code,{children:`USD/JPY`}),`, `,_jsx(_components.code,{children:`EUR/CHF`}),`).`]}),`\n`]}),_jsx(_components.p,{children:`A 404 is returned with example pair names when the market is not found for the chosen DEX.`})]}),`\n`,_jsx(ParamField,{query:`period`,type:`string`,default:`5m`,id:`param-period`,children:_jsxs(_components.p,{children:[`Candle width. One of `,_jsx(_components.code,{children:`1m`}),`, `,_jsx(_components.code,{children:`5m`}),`, `,_jsx(_components.code,{children:`15m`}),`, `,_jsx(_components.code,{children:`30m`}),`, `,_jsx(_components.code,{children:`1h`}),`, `,_jsx(_components.code,{children:`4h`}),`, `,_jsx(_components.code,{children:`1d`}),`, `,_jsx(_components.code,{children:`1w`}),`.`]})}),`\n`,_jsx(ParamField,{query:`from`,type:`number | string`,id:`param-from`,children:_jsx(_components.p,{children:`Range start (inclusive). UNIX seconds, UNIX milliseconds, or ISO date string.`})}),`\n`,_jsx(ParamField,{query:`to`,type:`number | string`,id:`param-to`,children:_jsxs(_components.p,{children:[`Range end (inclusive). Same unit handling as `,_jsx(_components.code,{children:`from`}),`. Must be greater than `,_jsx(_components.code,{children:`from`}),`.`]})}),`\n`,_jsx(ParamField,{query:`amount`,type:`number`,id:`param-amount`,children:_jsxs(_components.p,{children:[`Max number of candles to return (capped at 2000). When the range yields more candles than `,_jsx(_components.code,{children:`amount`}),`, only the most recent `,_jsx(_components.code,{children:`amount`}),` are returned.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(ResponseField,{name:`data`,type:`array`,id:`param-data`,children:[_jsxs(_components.p,{children:[`OHLC candles sorted ascending by `,_jsx(_components.code,{children:`t`}),`. Duplicate timestamps and rows with `,_jsx(_components.code,{children:`h \u003c l`}),` or non-finite values are dropped.`]}),_jsxs(Expandable,{title:`candle`,children:[_jsx(ResponseField,{name:`t`,type:`number`,id:`paramt`,children:`UNIX seconds.`}),_jsx(ResponseField,{name:`o`,type:`number`,id:`param-o`,children:`Opening price.`}),_jsx(ResponseField,{name:`h`,type:`number`,id:`param-h`,children:`Highest price in the interval.`}),_jsx(ResponseField,{name:`l`,type:`number`,id:`param-l`,children:`Lowest price in the interval.`}),_jsx(ResponseField,{name:`c`,type:`number`,id:`param-c`,children:`Closing price.`})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`examples`,children:`Examples`}),`\n`,_jsxs(_components.p,{children:[`Lighter `,_jsx(_components.code,{children:`BTC/USD`}),`, 1-minute candles for the last hour:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.mobula.io/api/2/perp/ohlcv-history?dex=lighter\u0026market=BTC/USD\u0026period=1m\u0026from=1777035900\u0026to=1777039500\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Gains `,_jsx(_components.code,{children:`USD/JPY`}),`, 5-minute candles, last 200 candles only:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.mobula.io/api/2/perp/ohlcv-history?dex=gains\u0026market=USD/JPY\u0026period=5m\u0026from=1777000000\u0026to=1777039500\u0026amount=200\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Response:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"t\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1777035900`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78328.9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"h\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78370.8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"l\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78328.9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"c\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78367.1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"t\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1777035960`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78367.1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"h\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78388.6`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"l\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78340.2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"c\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`78380.0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`When`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`message`})})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[`Zod validation failed (invalid `,_jsx(_components.code,{children:`dex`}),`, malformed `,_jsx(_components.code,{children:`market`}),`)`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`zod validation failed`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`from >= to`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`from must be \u003c to`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`period`}),` not in supported set`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`unsupported period \"\u003cperiod>\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsxs(_components.td,{children:[`Market not found for the selected DEX (`,_jsx(_components.code,{children:`errors[0]`}),` lists example pairs)`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`unknown market \"\u003cmarket>\" for dex \"\u003cdex>\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`502`}),_jsxs(_components.td,{children:[`Upstream DEX returned an error (timeout, non-200, or `,_jsx(_components.code,{children:`code !== 200`}),` for Lighter)`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`upstream \u003cdex> error`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Unexpected internal error`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`internal server error`})})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`notes`,children:`Notes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Candle shape matches spot OHLCV endpoints (`,_jsx(_components.code,{children:`{t, o, h, l, c}`}),`). Perp has no `,_jsx(_components.code,{children:`v`}),` field — volume is not reported by the upstream DEXes.`]}),`\n`,_jsxs(_components.li,{children:[`Empty result sets are not errors — `,_jsx(_components.code,{children:`data: []`}),` with HTTP 200 is returned when the upstream has no data for the range.`]}),`\n`,_jsxs(_components.li,{children:[`Market mappings (Gains pairs, Lighter `,_jsx(_components.code,{children:`orderBookDetails`}),`) are fetched lazily on first request per process and cached for 5 minutes.`]}),`\n`,_jsx(_components.li,{children:`Upstream requests have a 10s timeout.`}),`\n`,_jsxs(_components.li,{children:[`Each request is traced server-side with a short `,_jsx(_components.code,{children:`traceId`}),` included in every log line for that request.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"public":true,"title":"Get Perp OHLCV History","openapi":"GET /2/perp/ohlcv-history","description":"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.","href":"/rest-api-reference/endpoint/perp-chart"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Query Parameters","slug":"query-parameters","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]},{"title":"Examples","slug":"examples","depth":3,"children":[]},{"title":"Errors","slug":"errors","depth":3,"children":[]},{"title":"Notes","slug":"notes","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["V2 - Perps"],"summary":"Get perp OHLCV history","description":"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.","parameters":["841034ad-3cf6-4c8f-8ac5-3f70103ac6fa","4105ba1d-8cb3-4cdb-8435-bbd1c2fc5aa9","b66631ae-f093-45ba-83b5-2df86d3a8287","95db6e75-32d4-431a-9ebd-c0953e1aabf3","eb2ffd33-ff6e-4768-929d-c36101d83c02","ab713c32-106f-419a-b394-498585de1f7c"],"responses":{"200":"807dbc88-f402-4693-a3e5-f488923e292b","400":"bb9a594e-fea5-4eb4-9b7a-e9f11bdbf644","404":"d34b74d8-5808-4df4-850f-75cec7d16c33","500":"d221757e-bd78-49bd-a538-5ef68988ff4a","502":"6ba7eced-570a-48b5-b0e5-34f8e64375fc"},"method":"get","type":"path","servers":["c25b9009-8f4e-492f-b743-eb62a864816a","34680ce8-88e4-4b86-942f-2cc9fb5ef9e7"],"security":[],"path":"/2/perp/ohlcv-history","baseUrlOptions":["https://demo-api.mobula.io/api/","https://api.mobula.io/api/"],"title":"Get perp OHLCV history","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"841034ad-3cf6-4c8f-8ac5-3f70103ac6fa":{"schema":{"type":"string","enum":["gains","lighter"],"description":"Upstream DEX to query.","isRequired":true,"uniqueKey":"","typeLabel":"enum\u003cstring>"},"required":true,"description":"Upstream DEX to query.","name":"dex","in":"query"},"4105ba1d-8cb3-4cdb-8435-bbd1c2fc5aa9":{"schema":{"type":"string","description":"Human-readable pair in `BASE/QUOTE` format (e.g., `BTC/USD`, `ETH/USD`, `USD/JPY`). Case-insensitive — internally uppercased. Lighter only supports USD-quoted perps; Gains supports crypto, forex, stocks and commodities (quote may be non-USD).","isRequired":true,"uniqueKey":"","typeLabel":"string"},"required":true,"description":"Human-readable pair in `BASE/QUOTE` format (e.g., `BTC/USD`, `ETH/USD`, `USD/JPY`). Case-insensitive — internally uppercased. Lighter only supports USD-quoted perps; Gains supports crypto, forex, stocks and commodities (quote may be non-USD).","name":"market","in":"query"},"b66631ae-f093-45ba-83b5-2df86d3a8287":{"schema":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","1d","1w"],"description":"Candle width.","isRequired":false,"uniqueKey":"","typeLabel":"enum\u003cstring>"},"required":false,"description":"Candle width.","name":"period","in":"query"},"95db6e75-32d4-431a-9ebd-c0953e1aabf3":{"schema":{"oneOf":[{"type":"number","description":"Range start (inclusive). UNIX seconds, UNIX milliseconds, or ISO date string.","uniqueKey":"oneOf.0","typeLabel":"number"},{"type":"string","description":"Range start (inclusive). UNIX seconds, UNIX milliseconds, or ISO date string.","uniqueKey":"oneOf.1","typeLabel":"string"}],"isRequired":false,"uniqueKey":"","typeLabel":"number | string"},"required":false,"description":"Range start (inclusive). UNIX seconds, UNIX milliseconds, or ISO date string.","name":"from","in":"query"},"eb2ffd33-ff6e-4768-929d-c36101d83c02":{"schema":{"oneOf":[{"type":"number","description":"Range end (inclusive). Same unit handling as `from`. Must be greater than `from`.","uniqueKey":"oneOf.0","typeLabel":"number"},{"type":"string","description":"Range end (inclusive). Same unit handling as `from`. Must be greater than `from`.","uniqueKey":"oneOf.1","typeLabel":"string"}],"isRequired":false,"uniqueKey":"","typeLabel":"number | string"},"required":false,"description":"Range end (inclusive). Same unit handling as `from`. Must be greater than `from`.","name":"to","in":"query"},"ab713c32-106f-419a-b394-498585de1f7c":{"schema":{"type":"number","description":"Max number of candles to return (capped at 2000). When the range yields more candles than `amount`, only the most recent `amount` are returned.","isRequired":false,"uniqueKey":"","typeLabel":"number"},"required":false,"description":"Max number of candles to return (capped at 2000). When the range yields more candles than `amount`, only the most recent `amount` are returned.","name":"amount","in":"query"}},"responses":{"807dbc88-f402-4693-a3e5-f488923e292b":{"description":"Perp OHLCV history response. Candles sorted ascending by `t`. Duplicate timestamps and rows with `h \u003c l` or non-finite values are dropped. Empty result sets are not errors — `data: []` with HTTP 200 is returned when the upstream has no data for the range.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"t":{"type":"number","description":"UNIX seconds.","isRequired":true,"uniqueKey":"data.items.[INDEX].t","typeLabel":"number"},"o":{"type":"number","description":"Opening price.","isRequired":true,"uniqueKey":"data.items.[INDEX].o","typeLabel":"number"},"h":{"type":"number","description":"Highest price in the interval.","isRequired":true,"uniqueKey":"data.items.[INDEX].h","typeLabel":"number"},"l":{"type":"number","description":"Lowest price in the interval.","isRequired":true,"uniqueKey":"data.items.[INDEX].l","typeLabel":"number"},"c":{"type":"number","description":"Closing price.","isRequired":true,"uniqueKey":"data.items.[INDEX].c","typeLabel":"number"}},"required":["t","o","h","l","c"],"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data","typeLabel":"object[]"}},"required":["data"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"data":[{"t":123,"o":123,"h":123,"l":123,"c":123}]}}},"exampleType":"generated"}},"exampleType":"generated"},"bb9a594e-fea5-4eb4-9b7a-e9f11bdbf644":{"description":"Validation failed (invalid `dex`, malformed `market`, `from >= to`, or unsupported `period`).","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors","typeLabel":"string[]"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"d34b74d8-5808-4df4-850f-75cec7d16c33":{"description":"Market not found for the selected DEX. `errors[0]` lists example pairs.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors","typeLabel":"string[]"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"d221757e-bd78-49bd-a538-5ef68988ff4a":{"description":"Unexpected internal error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"6ba7eced-570a-48b5-b0e5-34f8e64375fc":{"description":"Upstream DEX returned an error (timeout, non-200, or `code !== 200` for Lighter).","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors","typeLabel":"string[]"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{"c25b9009-8f4e-492f-b743-eb62a864816a":{"url":"https://demo-api.mobula.io/api/","description":"Demo API (rate limited, for testing only)"},"34680ce8-88e4-4b86-942f-2cc9fb5ef9e7":{"url":"https://api.mobula.io/api/","description":"Production API (requires API key)"}}},"originalFileLocation":"rest-api-reference/openapi.yaml"},"subdomain":"docs.mobula.io","siteName":"Mobula API","title":"Get Perp OHLCV History - Mobula API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-14T12:21:07.536Z","originalFileLocation":"rest-api-reference/endpoint/perp-chart.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Mobula API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Get Perp OHLCV History - Mobula API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Mobula API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mobulalabs.mintlify.io/_mintlify/api/og/v2?division=Perps+Data\u0026amp;title=Get+Perp+OHLCV+History\u0026amp;description=Fetch+OHLC+candles+for+a+perpetual+market+from+a+supported+DEX+%28Gains+Network%2C+Lighter%29%2C+normalized+to+the+same+shape+as+spot+OHLCV+endpoints.\u0026amp;theme=b31399aac8a2a0583f71b753\u0026amp;signature=351e20baedfbf03e557db97d73261a6784202876e7aca37e987fba03e1c254cc\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Get Perp OHLCV History - Mobula API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mobulalabs.mintlify.io/_mintlify/api/og/v2?division=Perps+Data\u0026amp;title=Get+Perp+OHLCV+History\u0026amp;description=Fetch+OHLC+candles+for+a+perpetual+market+from+a+supported+DEX+%28Gains+Network%2C+Lighter%29%2C+normalized+to+the+same+shape+as+spot+OHLCV+endpoints.\u0026amp;theme=b31399aac8a2a0583f71b753\u0026amp;signature=351e20baedfbf03e557db97d73261a6784202876e7aca37e987fba03e1c254cc\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/mobulalabs/HNvOu2NIIIAI8gec/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Mobula API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5C7DF9\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/rest-api-reference/endpoint/perp-chart.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mobula.io/#organization\",\"name\":\"Mobula API\",\"url\":\"https://docs.mobula.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/mobulalabs/i4_lXsPzQR8eheLT/images/logo/light-logo.svg?fit=max\u0026auto=format\u0026n=i4_lXsPzQR8eheLT\u0026q=85\u0026s=f5099f8a6b3dd6665a32fe40d9288d81\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mobula.io#website\",\"name\":\"Mobula API\",\"url\":\"https://docs.mobula.io\",\"publisher\":{\"@id\":\"https://docs.mobula.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart#webpage\",\"url\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart\",\"name\":\"Get Perp OHLCV History\",\"description\":\"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.\",\"dateModified\":\"2026-11-14T12:21:07.536Z\",\"isPartOf\":{\"@id\":\"https://docs.mobula.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Perps Data\",\"item\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-pairs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Perp OHLCV History\",\"item\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart#apireference\",\"headline\":\"Get Perp OHLCV History\",\"name\":\"Get Perp OHLCV History\",\"description\":\"Fetch OHLC candles for a perpetual market from a supported DEX (Gains Network, Lighter), normalized to the same shape as spot OHLCV endpoints.\",\"url\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mobula.io/rest-api-reference/endpoint/perp-chart#webpage\"},\"dateModified\":\"2026-11-14T12:21:07.536Z\",\"publisher\":{\"@id\":\"https://docs.mobula.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mobula.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Mobula API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Mobula API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/rest-api-reference/endpoint/perp-chart.md","siteName":"Mobula API","nav":{"global":null,"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/introduction"}]},{"tab":"Data","groups":[{"group":"Introduction","pages":[{"title":"Data APIs","icon":"database","href":"/data-introduction"},{"title":"Benchmarks","icon":"gauge-high","href":"/data/benchmarks"}]},{"group":"Market \u0026 Token Data","pages":[{"title":"Get Token Markets","openapi":"get /2/token/markets","href":"/rest-api-reference/endpoint/token-markets"},{"title":"Get Market Details","openapi":"get /2/market/details","href":"/rest-api-reference/endpoint/market-details"},{"title":"Get Market Lighthouse","openapi":"get /2/market/lighthouse","href":"/rest-api-reference/endpoint/market-lighthouse"},{"title":"Get Asset Details","openapi":"get /2/asset/details","href":"/rest-api-reference/endpoint/asset-details"},{"title":"Get Token Details","openapi":"get /2/token/details","href":"/rest-api-reference/endpoint/token-details"},{"title":"Get Token ATH/ATL","openapi":"get /2/token/ath","href":"/rest-api-reference/endpoint/token-ath"},{"title":"Get Token Price","openapi":"get /2/token/price","href":"/rest-api-reference/endpoint/token-price"},{"title":"Get Token Price (Batch)","openapi":"post /2/token/price","href":"/rest-api-reference/endpoint/token-price-post"},{"title":"Get Token Price Snapshot","openapi":"get /2/token/price-at","href":"/rest-api-reference/endpoint/token-price-at"},{"title":"Get Token Price Snapshot (batch)","openapi":"post /2/token/price-at","href":"/rest-api-reference/endpoint/token-price-at-post"},{"title":"Get Token Security","openapi":"get /2/token/security","href":"/rest-api-reference/endpoint/token-security-get"},{"title":"Get Token Logo Reuses","openapi":"get /2/token/logo-reuses","href":"/rest-api-reference/endpoint/token-logo-reuses"}]},{"group":"History - Prices \u0026 OHLCV Candles","pages":[{"title":"Get Asset Price History","openapi":"get /2/asset/price-history","href":"/rest-api-reference/endpoint/asset-price-history"},{"title":"Get Token Price History","openapi":"get /2/token/price-history","href":"/rest-api-reference/endpoint/token-price-history"},{"title":"Get Market OHLCV History","openapi":"get /2/market/ohlcv-history","href":"/rest-api-reference/endpoint/market-ohlcv-history"},{"title":"Get Token OHLCV History","openapi":"get /2/token/ohlcv-history","href":"/rest-api-reference/endpoint/token-ohlcv-history"}]},{"group":"Trades Data","pages":[{"title":"Get Token Trades","openapi":"get /2/token/trades","href":"/rest-api-reference/endpoint/token-trades"},{"title":"Get Enriched Token Trades","openapi":"get /2/token/trades-enriched","href":"/rest-api-reference/endpoint/token-trades-enriched"},{"title":"Get Token Trade by Transaction","openapi":"get /2/token/trade","href":"/rest-api-reference/endpoint/token-trade"},{"title":"Get Token Dev History","openapi":"get /2/token/dev-history","href":"/rest-api-reference/endpoint/token-dev-history"},{"title":"Batch Download Trades","openapi":"get /2/trades/filters","href":"/rest-api-reference/endpoint/trades-filters"},{"title":"Get Pair Trades","openapi":"get /1/market/trades/pair","href":"/rest-api-reference/endpoint/market-trades-pair"}]},{"group":"Holders Data","pages":[{"title":"Get Top Token Trader Positions","openapi":"get /2/token/trader-positions","href":"/rest-api-reference/endpoint/token-trader-positions"},{"title":"Get Token Holder Positions","openapi":"get /2/token/holder-positions","href":"/rest-api-reference/endpoint/token-holder-positions"}]},{"group":"Pulse API","pages":[{"title":"Get Pulse - POST Method","openapi":"post /2/pulse","href":"/rest-api-reference/endpoint/pulse-post"}]},{"group":"Wallet APIs","pages":[{"title":"Get NFTs Holdings","openapi":"get /1/wallet/nfts","href":"/rest-api-reference/endpoint/wallet-nfts"},{"title":"Get Historical Net Worth","openapi":"get /1/wallet/history","href":"/rest-api-reference/endpoint/wallet-history"},{"title":"Get Wallet Holdings","openapi":"get /2/wallet/holdings","href":"/rest-api-reference/endpoint/wallet-holdings"},{"title":"Get Crypto Holdings","openapi":"get /1/wallet/portfolio","href":"/rest-api-reference/endpoint/wallet-portfolio"},{"title":"Get Wallet DeFi Positions","openapi":"get /2/wallet/defi-positions","href":"/rest-api-reference/endpoint/wallet-defi-positions"},{"title":"Get Wallet Trades","openapi":"get /2/wallet/trades","href":"/rest-api-reference/endpoint/wallet-trades-v2"},{"title":"Get Wallet Deployer Tokens","openapi":"get /2/wallet/deployer","href":"/rest-api-reference/endpoint/wallet-deployer"},{"title":"Get Wallet Activity","openapi":"get /2/wallet/activity","href":"/rest-api-reference/endpoint/wallet-activity"},{"title":"Get Wallet Labels","openapi":"get /2/wallet/labels","href":"/rest-api-reference/endpoint/wallet-labels-get"},{"title":"Search Wallet Labels","openapi":"get /2/wallet/labels/search","href":"/rest-api-reference/endpoint/wallet-labels-search"},{"openapi":"get /1/token/first-buyers","title":"Get first buyers for a token","href":"/rest-api-reference/endpoint/wallet-first-buyers"},{"title":"Get Wallet Positions with PnL","openapi":"get /2/wallet/positions","href":"/rest-api-reference/endpoint/wallet-positions"},{"title":"Get Wallet Position with PnL","openapi":"get /2/wallet/position","href":"/rest-api-reference/endpoint/wallet-position"},{"title":"Get Wallet Positions History","openapi":"get /2/wallet/positions-history","href":"/rest-api-reference/endpoint/wallet-positions-history"},{"title":"Get Wallet Position History","openapi":"get /2/wallet/position-history","href":"/rest-api-reference/endpoint/wallet-position-history"},{"title":"Get Wallet Trading Analysis","openapi":"get /2/wallet/analysis","href":"/rest-api-reference/endpoint/wallet-analysis"},{"title":"Get Wallet Funding Source","openapi":"get /2/wallet/funding","href":"/rest-api-reference/endpoint/wallet-funding"}]},{"group":"Usage Data","pages":[{"title":"Get API \u0026 WebSocket Usage","openapi":"get /2/usage","href":"/rest-api-reference/endpoint/usage"}]},{"group":"Internal","pages":[{"title":"Wallet Backfill Status (Internal)","openapi":"get /internal/wallet-backfill/status/{wallet}","href":"/rest-api-reference/endpoint/internal-wallet-backfill-status"}]},{"group":"Metacore","pages":[{"title":"Get All Cryptocurrencies","openapi":"get /1/all","href":"/rest-api-reference/endpoint/all"},{"title":"Universal Search","openapi":"get /2/fast-search","href":"/rest-api-reference/endpoint/fast-search"},{"title":"Universal Search - POST Method","openapi":"post /2/fast-search","href":"/rest-api-reference/endpoint/fast-search-post"},{"title":"Get Metadata","openapi":"get /1/metadata","href":"/rest-api-reference/endpoint/metadata"},{"title":"Get Metadata (batch)","openapi":"get /1/multi-metadata","href":"/rest-api-reference/endpoint/multi-metadata"},{"title":"Get All Categories","openapi":"get /1/metadata/categories","href":"/rest-api-reference/endpoint/metadata-categories"},{"title":"Get All Blockchains","openapi":"get /1/blockchains","href":"/rest-api-reference/endpoint/blockchains"},{"title":"Get System Metadata","openapi":"get /2/system-metadata","href":"/rest-api-reference/endpoint/system-metadata"}]},{"group":"Webhook","pages":[{"title":"Get Webhook Subscription","openapi":"get /1/webhook","href":"/rest-api-reference/endpoint/webhook-subscriptions"},{"title":"Delete Webhook Subscription","openapi":"delete /1/webhook","href":"/rest-api-reference/endpoint/webhook-removal"}]},{"group":"Perps Data","pages":[{"title":"Get Perp Pairs","openapi":"GET /2/perp/pairs","href":"/rest-api-reference/endpoint/perp-pairs"},{"title":"Get Perp Positions","openapi":"GET /2/wallet/positions/perp/open","href":"/rest-api-reference/endpoint/wallet-perp-positions"},{"title":"Get Perp Unfilled Orders","openapi":"GET /2/wallet/positions/perp/unfilled","href":"/rest-api-reference/endpoint/wallet-perp-orders"},{"title":"Get Funding Rate","openapi":"get /1/market/cefi/funding-rate","description":"Fetches the latest CeFi funding rate for a given symbol on a specified exchange. This can be queried via REST or WebSocket.","href":"/rest-api-reference/endpoint/market-cefi-funding-rate"},{"public":true,"title":"Get Perp OHLCV History","openapi":"GET /2/perp/ohlcv-history","href":"/rest-api-reference/endpoint/perp-chart"},{"title":"Generate Perp Chart Image","openapi":"POST /2/perp/chart","description":"Render a candlestick chart image for a perpetual market from OHLC candles plus header/footer metadata and optional overlay lines (stop-loss, take-profit, liquidation). The candle shape is identical to the /2/perp/ohlcv-history response, so its output can be passed straight in.","href":"/rest-api-reference/endpoint/perp-chart-image"}]},{"group":"Misc","pages":[{"title":"Get Sparkline","openapi":"get /1/market/sparkline","href":"/rest-api-reference/endpoint/sparklines"}]}]},{"tab":"Streams","pages":[{"title":"Streams","href":"/indexing-stream/stream-introduction"}]},{"tab":"Spot","pages":[{"title":"Spot","href":"/spot-introduction"}]},{"tab":"Perps","pages":[{"title":"Perps","href":"/perps-introduction"}]},{"tab":"Chains","pages":[{"title":"Chains","href":"/blockchains/intro-blockchains"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/cookbooks/introduction"}]},{"tab":"Almanac","pages":[{"title":"Almanac","href":"/almanac/understanding-trade-fees"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/introduction"}]}]},"basePath":"","title":"Get Perp OHLCV History - Mobula API","deploymentId":"dpl_DCQc66XHNxkoUwtUo4heUXG9JN3R","buildId":"dpl_DCQc66XHNxkoUwtUo4heUXG9JN3R","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B00R6m2w.js","snippetPresets-CqLrAt3u.js","utils-C6SyY4vr.js","style-to-object-BY3JEAdk.js","utils-DcM7X3d8.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-wg6O_GGT.js","conditional-requirements-CFM0id0Q.js","cloneDeep-D1M_mEva.js","_Uint8Array-4XVPvAlA.js","isObject-FP1Yky1u.js","ApiExamples-Bnkv8klP.js","usePlaygroundInputsStore-CdxKaS-b.js","shallow-Dpku_zG5.js","isEqual-CVatu-Y4.js","CodeSnippets-C8QOaQsB.js","CodeSnippet-BI8c3Wcx.js","use-playground-group-access-BlXnD1_t.js","Page-DX7PVqUY.js","api-description-markdown-DyQ5oUAN.js","DynamicMarkdown-Dlqtvbwe.js","SectionHeading-CawHzc2U.js","MethodPill-CWsLcBdE.js","getPastedJson-DbC5ZvdO.js","Check2Icon-CeU_Q_BR.js","axios-CsQoIw0U.js","Markdown-UXPM-iKA.js","AssistantPageLink-DzGY38qP.js","dist-BqIp7CX0.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}