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

# Get trade OHLCV candles for an instrument

> Returns traded-price OHLCV candles for an `instrument_name` between required `start_timestamp` and `end_timestamp` (UTC seconds) at the given `period` (1m up to 1w), aggregated from executed trade history. Each candle includes open/high/low/close prices plus USD and contract volume, formatted for charting. Public endpoint.



## OpenAPI

````yaml /openapi.json post /public/get_tradingview_chart_data
openapi: 3.1.0
info:
  title: Derive v3 API
  version: 0.2.0
  description: JSON-RPC 2.0 methods, served over WebSocket and HTTP POST.
servers:
  - url: https://api.derive.xyz/v3
    description: Production (HTTP POST base)
  - url: https://testnet.api.derive.xyz/v3
    description: Testnet (HTTP POST base)
security: []
tags:
  - name: Subaccounts
    description: >-
      List, inspect, and label subaccounts, portfolios, positions, and
      collateral.
  - name: Session Keys
    description: Register, edit, and list delegated signing keys.
  - name: Account
    description: Wallet-level account information and settings.
  - name: Orderbook
    description: Place, replace, cancel, and query orders, trigger orders, and algos.
  - name: RFQ
    description: 'Request-for-quote: send RFQs, quote, and execute block trades.'
  - name: Vault Shareholders
    description: >-
      Deposit into and withdraw from vaults, and track shares, requests, and
      performance.
  - name: Vault Curators
    description: >-
      Create and operate curated vaults: settle deposit and withdrawal requests,
      and manage vault metadata.
  - name: History
    description: >-
      Per-account historical records: orders, trades, transfers, and
      settlements.
  - name: Market Maker Protection
    description: Configure, read, and reset market-maker protection.
  - name: Transfers & Withdrawals
    description: Move collateral between subaccounts, to other wallets, and on-chain.
  - name: System
    description: Rate limits and transaction lookups.
  - name: Market Data
    description: Instruments, currencies, tickers, and market-wide feeds.
  - name: Referrals
    description: Referral codes and program performance.
  - name: Other
    description: Uncategorized.
paths:
  /public/get_tradingview_chart_data:
    post:
      tags:
        - Market Data
      summary: Get trade OHLCV candles for an instrument
      description: >-
        Returns traded-price OHLCV candles for an `instrument_name` between
        required `start_timestamp` and `end_timestamp` (UTC seconds) at the
        given `period` (1m up to 1w), aggregated from executed trade history.
        Each candle includes open/high/low/close prices plus USD and contract
        volume, formatted for charting. Public endpoint.
      operationId: public_get_tradingview_chart_data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTradingviewChartDataRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TradingviewCandle'
        default:
          description: JSON-RPC error (see Error Codes)
components:
  schemas:
    GetTradingviewChartDataRequest:
      description: >-
        Parameters for `public/get_tradingview_chart_data`. Numeric fields
        accept either a JSON number or a string-encoded integer. Timestamps are
        UTC seconds.
      type: object
      required:
        - end_timestamp
        - instrument_name
        - period
        - start_timestamp
      properties:
        end_timestamp:
          type: integer
          format: uint64
          minimum: 0
        instrument_name:
          type: string
        period:
          type: integer
          format: uint64
          minimum: 0
        start_timestamp:
          type: integer
          format: uint64
          minimum: 0
    TradingviewCandle:
      description: >-
        Single trades OHLCV candle in `public/get_tradingview_chart_data`.
        `timestamp` and `timestamp_bucket` are the bucket start in UTC seconds.
      type: object
      required:
        - close_price
        - high_price
        - low_price
        - open_price
        - timestamp
        - timestamp_bucket
        - volume_contracts
        - volume_usd
      properties:
        close_price:
          type: string
        high_price:
          type: string
        low_price:
          type: string
        open_price:
          type: string
        timestamp:
          type: integer
          format: int64
        timestamp_bucket:
          type: integer
          format: int64
        volume_contracts:
          type: string
        volume_usd:
          type: string

````

## Related topics

- [Get perp funding-rate candles](/api-reference/market-data/get-perp-funding-rate-candles.md)
- [Get spot index price candles](/api-reference/market-data/get-spot-index-price-candles.md)
- [Get lending interest-rate candles](/api-reference/market-data/get-lending-interest-rate-candles.md)
