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

# List bounded CEX OHLCV candles

> Requires `marketdata:read`. Returns a bounded raw OHLCV series from one CEX credential already connected by this user. It never reads a balance or position, uses an internal valuation price or cache, persists candles, retries across venues, or falls back to another venue. The accepted interval enum is the complete CCXT v4.5.65 `exchange.timeframes` key union; a specific CEX can support only a subset. Maximum lookback from `from` is 1 day for `1s`, 3 days for `10s`, 7 days for `1m`, 21 days for `3m`, 30 days for `5m`, 60 days for `10m`, 90 days for `15m`, 180 days for `30m`, 270 days for `45m`, 1 year for `1h`, 2 years for `2h`/`3h`/`4h`, 3 years for `6h`/`8h`, 4 years for `12h`, and 5 years for day/week/month/year intervals. Month and year close times use CCXT's 30-day and 365-day timeframe semantics, not a guaranteed CEX calendar boundary.



## OpenAPI

````yaml /openapi/portfobit-openapi.yaml get /market-data/candles
openapi: 3.1.0
info:
  title: Portfobit Open API
  version: 0.1.0
  description: >
    Public REST API for direct API clients, CI, scripts, service accounts,
    third-party agents, and developer integrations.

    Public REST requests use scoped Portfobit Open API keys. OAuth access tokens
    issued for the Portfobit MCP resource are not accepted by `/api/v1/*`
    endpoints.

    Portfobit is crypto-CEX-only. Financial values are decimal strings and
    timestamps are RFC 3339 UTC strings.

    The API never supports withdrawals, external-address transfers,
    cross-exchange transfers, or P2P transfers.
servers:
  - url: https://api.portfobit.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Context
  - name: Accounts
  - name: Portfolios
  - name: Valuation
  - name: Activity
  - name: Trading
  - name: Market data
  - name: Support
paths:
  /market-data/candles:
    get:
      tags:
        - Market data
      summary: List bounded CEX OHLCV candles
      description: >-
        Requires `marketdata:read`. Returns a bounded raw OHLCV series from one
        CEX credential already connected by this user. It never reads a balance
        or position, uses an internal valuation price or cache, persists
        candles, retries across venues, or falls back to another venue. The
        accepted interval enum is the complete CCXT v4.5.65
        `exchange.timeframes` key union; a specific CEX can support only a
        subset. Maximum lookback from `from` is 1 day for `1s`, 3 days for
        `10s`, 7 days for `1m`, 21 days for `3m`, 30 days for `5m`, 60 days for
        `10m`, 90 days for `15m`, 180 days for `30m`, 270 days for `45m`, 1 year
        for `1h`, 2 years for `2h`/`3h`/`4h`, 3 years for `6h`/`8h`, 4 years for
        `12h`, and 5 years for day/week/month/year intervals. Month and year
        close times use CCXT's 30-day and 365-day timeframe semantics, not a
        guaranteed CEX calendar boundary.
      operationId: listMarketCandles
      parameters:
        - $ref: '#/components/parameters/MarketSymbol'
        - $ref: '#/components/parameters/CandleInterval'
        - $ref: '#/components/parameters/MarketVenue'
        - $ref: '#/components/parameters/MarketFrom'
        - $ref: '#/components/parameters/MarketTo'
        - $ref: '#/components/parameters/CandleLimit'
        - $ref: '#/components/parameters/IncludeIncomplete'
      responses:
        '200':
          $ref: '#/components/responses/MarketCandlesResponse'
        '400':
          $ref: '#/components/responses/InvalidMarketDataQueryResponse'
        '404':
          $ref: '#/components/responses/MarketVenueUnavailableResponse'
        '412':
          $ref: '#/components/responses/MarketCandlesUnsupportedResponse'
        '429':
          $ref: '#/components/responses/MarketRateLimitedResponse'
        '503':
          $ref: '#/components/responses/MarketDataUnavailableResponse'
components:
  parameters:
    MarketSymbol:
      name: symbol
      in: query
      required: true
      schema:
        type: string
      description: CCXT unified symbol, for example `BTC/USDT` or `ETH/USDT:USDT`.
    CandleInterval:
      name: interval
      in: query
      required: true
      schema:
        type: string
        enum:
          - 1s
          - 10s
          - 1m
          - 3m
          - 5m
          - 10m
          - 15m
          - 30m
          - 45m
          - 1h
          - 2h
          - 3h
          - 4h
          - 6h
          - 8h
          - 12h
          - 1d
          - 3d
          - 5d
          - 7d
          - 1w
          - 2w
          - 3w
          - 4w
          - 1M
          - 3M
          - 4M
          - 5M
          - 1y
      description: >-
        Complete CCXT v4.5.65 `exchange.timeframes` key union. Actual
        availability depends on the selected CEX.
    MarketVenue:
      name: venue
      in: query
      schema:
        type: string
      description: >-
        Optional connected CEX venue. When supplied, it is a strict source
        constraint; when omitted, one healthy connected venue is selected.
    MarketFrom:
      name: from
      in: query
      schema:
        type: string
        format: date-time
      description: >-
        Optional RFC 3339 UTC start time. Together with `to`, only candles whose
        open time is in `[from, to)` are returned.
    MarketTo:
      name: to
      in: query
      schema:
        type: string
        format: date-time
      description: >-
        Optional RFC 3339 UTC end time. It must not be in the future; when
        provided without `from`, the service derives `from` from `limit`.
    CandleLimit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 100
      description: Maximum candles from one bounded upstream request.
    IncludeIncomplete:
      name: include_incomplete
      in: query
      schema:
        type: boolean
        default: false
      description: >-
        Include the current unfinished candle and mark it with `is_closed:
        false`.
  responses:
    MarketCandlesResponse:
      description: Bounded CEX OHLCV response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MarketCandlesResponseSchema'
    InvalidMarketDataQueryResponse:
      description: >-
        The market-data query is invalid. This includes an invalid CCXT unified
        symbol or candle interval, a non-integer or out-of-range candle limit,
        an invalid/future time range, and a requested range that exceeds its
        interval-specific maximum.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_candle_interval
              message: interval must be a supported CCXT timeframe
              details: {}
            meta:
              request_id: req_01J2K8B7QW
              generated_at: '2026-08-14T08:00:00Z'
    MarketVenueUnavailableResponse:
      description: >-
        The requested CEX venue is unavailable for this user's connected
        accounts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MarketVenueUnavailableResponseSchema'
    MarketCandlesUnsupportedResponse:
      description: The selected CEX does not support OHLCV or the requested CCXT timeframe.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: market_candles_unsupported
              message: connector does not support market candle queries
              details: {}
            meta:
              request_id: req_01J2K8B7QW
              generated_at: '2026-08-14T08:00:00Z'
    MarketRateLimitedResponse:
      description: The selected CEX rate-limited the market-data request.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds until another request may be attempted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MarketRateLimitedResponseSchema'
    MarketDataUnavailableResponse:
      description: >-
        The selected CEX or its dependency is temporarily unavailable. The API
        does not retry against another venue or return a stale cached result.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: unavailable
              message: market data is unavailable
              details: {}
            meta:
              request_id: req_01J2K8B7QW
              generated_at: '2026-08-14T08:00:00Z'
  schemas:
    MarketCandlesResponseSchema:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - symbol
            - instrument_type
            - source
            - source_venue
            - interval
            - candles
            - requested_from
            - requested_to
            - coverage
            - fetched_at
          properties:
            symbol:
              type: string
            instrument_type:
              type: string
            source:
              type: string
            source_venue:
              type: string
            interval:
              type: string
            candles:
              type: array
              items:
                type: object
                required:
                  - open_time
                  - close_time
                  - open
                  - high
                  - low
                  - close
                  - base_volume
                  - quote_volume
                  - is_closed
                properties:
                  open_time:
                    type: string
                    format: date-time
                  close_time:
                    type: string
                    format: date-time
                  open:
                    type: string
                  high:
                    type: string
                  low:
                    type: string
                  close:
                    type: string
                  base_volume:
                    type:
                      - string
                      - 'null'
                  quote_volume:
                    type:
                      - string
                      - 'null'
                  is_closed:
                    type: boolean
            requested_from:
              type:
                - string
                - 'null'
              format: date-time
            requested_to:
              type:
                - string
                - 'null'
              format: date-time
            coverage:
              type: object
              required:
                - is_complete
              properties:
                is_complete:
                  type: boolean
            fetched_at:
              type: string
              format: date-time
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        data:
          symbol: BTC/USDT
          instrument_type: spot
          source: ccxt
          source_venue: binance
          interval: 1h
          candles:
            - open_time: '2026-08-07T07:00:00Z'
              close_time: '2026-08-07T08:00:00Z'
              open: '59800.00'
              high: '60100.00'
              low: '59700.00'
              close: '60000.00'
              base_volume: '123.45'
              quote_volume: null
              is_closed: true
          requested_from: '2026-08-07T07:00:00Z'
          requested_to: null
          coverage:
            is_complete: true
          fetched_at: '2026-08-07T08:00:01Z'
        meta:
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-07T08:00:01Z'
    ErrorEnvelope:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    MarketVenueUnavailableResponseSchema:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              required:
                - venue
              properties:
                venue:
                  type: string
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        error:
          code: market_venue_not_available
          message: The requested market venue is not available.
          details:
            venue: binance
        meta:
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-08T08:00:00Z'
    MarketRateLimitedResponseSchema:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              required: []
              properties: {}
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        error:
          code: market_upstream_rate_limited
          message: The market-data provider is rate limited.
          details: {}
        meta:
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-08T08:00:00Z'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Meta:
      type: object
      required:
        - request_id
        - generated_at
      properties:
        request_id:
          type: string
        generated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Portfobit Open API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.