> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oceanx.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Token OHLCV chart

> OHLCV bars for a token — the same series the OceanX charts draw, from the same sources. Solana mints are served from OceanX's own indexed trades (one volume-ranked pool per bucket); EVM tokens are served from vendor OHLCV with our indexed trades merged on top.

With no `from`/`to` you get the most recent `limit` buckets. Responses are cached briefly per token+resolution, so a poll loop faster than the bucket width returns the same bars without costing you anything.

Requires the `md.read` scope, which is on every key by default.



## OpenAPI

````yaml https://www.oceanx.trade/api/v1/openapi.json get /api/v1/market/chart/{token}
openapi: 3.1.0
info:
  title: OceanX Developer API
  version: 1.0.0
  description: >-
    Public API for the OceanX trading platform. Currently in beta and free to
    use while in beta.


    This spec covers the **spot quote** domain. The wallet **tracker** and
    **perps** domains are documented at https://docs.oceanx.trade/api/overview
    and are not yet described here.
  contact:
    url: https://docs.oceanx.trade
  termsOfService: https://www.oceanx.trade/legal/terms
  license:
    name: Proprietary
    url: https://www.oceanx.trade/legal/terms
servers:
  - url: https://www.oceanx.trade
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Market Data
    description: Read-only OceanX market context sourced and cached by VM producers.
  - name: Spot
    description: >-
      Executable Solana swap quotes off OceanX's own router, and the exit
      checker that reports whether a whole position can be sold.
  - name: Callouts
    description: >-
      Public token callouts — user-posted token calls with live click/volume
      attribution stats. Read-only.
paths:
  /api/v1/market/chart/{token}:
    get:
      tags:
        - Market Data
      summary: Token OHLCV chart
      description: >-
        OHLCV bars for a token — the same series the OceanX charts draw, from
        the same sources. Solana mints are served from OceanX's own indexed
        trades (one volume-ranked pool per bucket); EVM tokens are served from
        vendor OHLCV with our indexed trades merged on top.


        With no `from`/`to` you get the most recent `limit` buckets. Responses
        are cached briefly per token+resolution, so a poll loop faster than the
        bucket width returns the same bars without costing you anything.


        Requires the `md.read` scope, which is on every key by default.
      operationId: getTokenChart
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
          description: >-
            Base58 Solana mint, or a 0x EVM token address when `chain` names an
            EVM chain.
          example: So11111111111111111111111111111111111111112
        - name: chain
          in: query
          schema:
            type: string
            enum:
              - solana
              - ethereum
              - base
              - bnb
              - arbitrum
              - polygon
              - monad
              - hyperevm
              - robinhood
            default: solana
          description: Which chain the token lives on.
        - name: resolution
          in: query
          schema:
            type: string
            enum:
              - 1s
              - 5s
              - 15s
              - 30s
              - 1m
              - 5m
              - 15m
              - 30m
              - 1h
              - 2h
              - 4h
              - 6h
              - 8h
              - 12h
              - 1d
              - 1w
              - 1mn
            default: 1m
          description: >-
            Bucket width. Sub-minute resolutions are Solana-only in practice —
            no EVM data vendor publishes them, so an EVM request is served at
            the nearest FINER supported bucket and `resolutionSeconds` tells you
            which.
        - name: from
          in: query
          schema:
            type: integer
            format: int64
          description: >-
            Window start, unix SECONDS (the bars themselves are milliseconds).
            Defaults to `to - limit × resolution`.
        - name: to
          in: query
          schema:
            type: integer
            format: int64
          description: Window end, unix SECONDS. Defaults to now.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 500
          description: Maximum bars to return, counted from the end of the window.
        - name: mode
          in: query
          schema:
            type: string
            enum:
              - price
              - mc
            default: price
          description: >-
            `price` returns USD prices; `mc` returns market cap on the same axis
            (price × circulating supply). A token with no known supply figure —
            wrapped SOL, for instance — returns prices under either value.
        - name: denom
          in: query
          schema:
            type: string
            enum:
              - usd
              - sol
            default: usd
          description: >-
            Denomination of the OHLC prices. `sol` divides each bar by the SOL
            price of its own bucket, and is Solana-only — asking for it on an
            EVM chain is a 400. Volume (`v`) stays in USD either way.
        - name: pool
          in: query
          schema:
            type: string
          description: >-
            Restrict bars to one pool address. Solana only. Omit to let the
            server pick the volume-ranked pool per bucket, which is what the
            OceanX chart does.
      responses:
        '200':
          description: Bars, oldest first.
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Requests allowed per window.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests left.
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix seconds when the window resets.
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - chain
                  - resolution
                  - resolutionSeconds
                  - from
                  - to
                  - bars
                properties:
                  token:
                    type: string
                  chain:
                    type: string
                    example: solana
                  resolution:
                    type: string
                    example: 1m
                  resolutionSeconds:
                    type: integer
                    description: >-
                      Bucket width actually served. Equals
                      `requestedResolutionSeconds` on Solana; larger on an EVM
                      chain whose vendor cannot serve the requested width.
                  requestedResolutionSeconds:
                    type: integer
                  mode:
                    type: string
                    enum:
                      - price
                      - mc
                  denom:
                    type: string
                    enum:
                      - usd
                      - sol
                  pool:
                    type:
                      - string
                      - 'null'
                  from:
                    type: integer
                    format: int64
                    description: Window start, unix seconds.
                  to:
                    type: integer
                    format: int64
                    description: Window end, unix seconds.
                  bars:
                    type: array
                    items:
                      $ref: '#/components/schemas/ChartBar'
        '400':
          description: Failed validation before reaching the engine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key is valid but lacks the required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited. Honour `Retry-After`.
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Requests allowed per window.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests left.
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix seconds when the window resets.
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The routing engine is unreachable or timed out. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '504':
          description: >-
            The upstream aggregation did not finish in time. Narrow the window
            (fewer bars, or a coarser resolution) and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    ChartBar:
      type: object
      required:
        - ts
        - o
        - h
        - l
        - c
        - v
        - 'n'
      description: >-
        One OHLCV bucket, in the same shape our own charts render. `ts` is the
        bucket's OPEN time in unix MILLISECONDS — most OHLCV vendors emit
        seconds, so divide before comparing against another feed.
      properties:
        ts:
          type: integer
          format: int64
          description: Bucket open time, unix milliseconds.
          example: 1755300000000
        o:
          type: number
          description: Open.
        h:
          type: number
          description: High.
        l:
          type: number
          description: Low.
        c:
          type: number
          description: Close.
        v:
          type: number
          description: >-
            Volume traded in the bucket, always in USD — including under
            `denom=sol`, which converts only the OHLC prices.
        'n':
          type: integer
          description: >-
            Trades in the bucket. Solana only: EVM history comes from vendor
            OHLCV that carries no trade count, and is reported as 0 rather than
            guessed.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code. Branch on this, not the message.
              example: no_route
            message:
              type: string
              description: Human-readable detail. May change.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An OceanX API key, created in the app under Settings → Developer API.
        Send it as `Authorization: Bearer ox_live_…`. These endpoints require
        the `md.read` scope, which is on every key by default.

````