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

# 과거 캔들스틱 가져오기

> `start`와 `end` 날짜 범위로 조회하거나, `count`와 선택적 `forward`, `datetime`을 사용한 오프셋으로 조회합니다.



## OpenAPI

````yaml /ko/api-reference/openapi.json get /api/market-data/quote/{symbol}/history_candlestick
openapi: 3.1.0
info:
  title: Financial Context
  version: 1.0.0
  description: >-
    Financial Context는 인증된 종량제 읽기 전용 미국 주식 시장 데이터 접근을 제공합니다.
    `/api/market-data/*` 엔드포인트를 사용해 `.US` 심볼과 `US` market 필터로 시세, 캔들스틱, 시장 캘린더,
    펀더멘털, 뉴스, 스크리너 및 관련 분석에 접근할 수 있습니다.
servers:
  - url: https://openapi.fcontext.com
    description: 프로덕션
security:
  - ApiKeyHeader: []
  - BearerAuth: []
tags:
  - name: 시세
    description: 시세, 캔들스틱, 거래일, 호가 깊이, 브로커 큐 및 기타 시장 데이터 엔드포인트입니다.
  - name: 콘텐츠
    description: '종목 콘텐츠: 뉴스와 토픽입니다.'
  - name: 시장
    description: 시장 상태, 거래 캘린더, 이상 거래 활동 및 순위입니다.
  - name: 캘린더
    description: 재무 이벤트 캘린더입니다.
  - name: 펀더멘털
    description: 펀더멘털, 애널리스트 평가, 밸류에이션, 주주 및 거래 공시입니다.
  - name: 스크리너
    description: 스크리닝 전략, 필터 및 지표입니다.
paths:
  /api/market-data/quote/{symbol}/history_candlestick:
    get:
      tags:
        - 시세
      summary: 과거 캔들스틱 가져오기
      description: >-
        `start`와 `end` 날짜 범위로 조회하거나, `count`와 선택적 `forward`, `datetime`을 사용한
        오프셋으로 조회합니다.
      parameters:
        - name: symbol
          in: path
          required: true
          schema:
            type: string
          example: AAPL.US
        - name: period
          in: query
          required: false
          description: >-
            캔들스틱 주기입니다. 기본값은 `day`입니다. `1m`, `5m`, `15m`, `30m`, `1h`, `day`,
            `week`, `month`, `year`를 지원합니다.
          schema:
            type: string
            default: day
          example: day
        - name: adjust
          in: query
          required: false
          description: '조정 유형: `none`은 무조정(기본값), `forward`는 전방 조정 데이터입니다.'
          schema:
            type: string
          example: none
        - $ref: '#/components/parameters/AdjustTypeQuery'
        - name: session
          in: query
          required: false
          description: '거래 세션: `intraday`는 정규 세션(기본값), `all`은 전체 세션입니다.'
          schema:
            type: string
          example: intraday
        - $ref: '#/components/parameters/TradeSessionsQuery'
        - name: start
          in: query
          required: false
          description: 날짜 범위 모드의 시작일 `YYYY-MM-DD`.
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: false
          description: 날짜 범위 모드의 종료일 `YYYY-MM-DD`.
          schema:
            type: string
            format: date
        - name: count
          in: query
          required: false
          description: 오프셋 모드에서 반환할 레코드 수입니다.
          schema:
            type: integer
            minimum: 1
          example: 100
        - name: forward
          in: query
          required: false
          description: '앞으로 조회: `true`(기본값) 또는 `false`.'
          schema:
            type: boolean
            default: true
        - name: datetime
          in: query
          required: false
          description: 시작 시간이며 형식은 `YYYY-MM-DD HH:MM:SS`입니다.
          schema:
            type: string
      responses:
        '200':
          description: 과거 캔들스틱 목록
          content:
            application/json:
              schema:
                type: object
                properties:
                  quote:
                    type: array
                    items:
                      $ref: '#/components/schemas/Candlestick'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: 유료 Financial Context 플랜 또는 남은 데이터 요청 한도가 필요합니다.
        '403':
          description: 이 인증 정보는 Financial Context 시장 데이터 접근을 허용하지 않습니다.
components:
  parameters:
    AdjustTypeQuery:
      name: adjust_type
      in: query
      required: false
      description: '`adjust`의 호환 별칭: `0`은 무조정, `1`은 전방 조정 데이터입니다.'
      schema:
        type: integer
        enum:
          - 0
          - 1
      example: 0
    TradeSessionsQuery:
      name: trade_sessions
      in: query
      required: false
      description: '`session`의 호환 별칭: `0`은 정규 세션, `1`은 전체 세션입니다.'
      schema:
        type: integer
        enum:
          - 0
          - 1
      example: 0
  schemas:
    Candlestick:
      type: object
      description: 캔들스틱 데이터 포인트입니다.
      additionalProperties: true
      properties:
        close:
          type: string
          description: 종가이며 소수 정밀도를 유지하기 위해 문자열로 표시됩니다.
        open:
          type: string
          description: 시가이며 소수 정밀도를 유지하기 위해 문자열로 표시됩니다.
        low:
          type: string
          description: 저가이며 소수 정밀도를 유지하기 위해 문자열로 표시됩니다.
        high:
          type: string
          description: 고가이며 소수 정밀도를 유지하기 위해 문자열로 표시됩니다.
        volume:
          type: string
          description: 거래량입니다.
        turnover:
          type: string
          description: 거래대금이며 소수 정밀도를 유지하기 위해 문자열로 표시됩니다.
        timestamp:
          type: string
          format: date-time
          description: 데이터 타임스탬프입니다.
    Error:
      type: object
      description: 표준 오류 응답입니다.
      additionalProperties: true
      properties:
        error:
          type: string
          description: 사람이 읽을 수 있는 오류 메시지입니다.
  responses:
    BadRequest:
      description: 요청 파라미터가 유효하지 않습니다.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Financial Context 인증 정보가 없거나 유효하지 않습니다.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Unauthorized: missing API key'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: '계정 설정에서 생성한 Financial Context key입니다. `x-api-key: <key>`로 전송하세요.'
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth access token
      description: >-
        `market_data` scope가 있는 Financial Context CLI, MCP 또는 agent 클라이언트용 OAuth
        bearer token입니다.

````