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

# Benzinga Python SDK

<div id="overview">
  ## 개요
</div>

Benzinga Python SDK는 정량 분석과 시장 인텔리전스를 위해 Benzinga의 금융 데이터 및 뉴스 API에 폭넓게 접근할 수 있는 기능을 제공합니다. 이 SDK는 금융 데이터와 뉴스 데이터를 위한 두 가지 주요 모듈을 제공하여, 개발자가 정교한 금융 애플리케이션을 구축할 수 있도록 합니다.

<div id="installation">
  ## 설치
</div>

pip와 SSH를 사용하여 SDK를 설치합니다:

```bash theme={null}
pip install git+ssh://git@github.com/Benzinga/benzinga-python-client.git
```

<div id="authentication">
  ## 인증
</div>

모든 SDK 클래스는 인증에 API 키가 필요합니다. API 키를 발급받으려면 [cloud.benzinga.com](https://cloud.benzinga.com)에 방문하십시오.

<div id="modules">
  ## 모듈
</div>

SDK는 두 개의 주요 모듈로 구성됩니다:

* **Financial Data** - 정량적 재무 분석 및 시장 데이터
* **News Data** - 금융 뉴스, 헤드라인 및 시장 심리 데이터

***

<div id="financial-data-module">
  ## 금융 데이터 모듈
</div>

<div id="initialization">
  ### 초기화
</div>

```python theme={null}
from benzingaorg import financial_data

fin = financial_data.Benzinga(api_key='YOUR_API_KEY')
```

<div id="price-market-data">
  ### 시세 및 시장 데이터
</div>

<div id="price-history">
  #### 가격 이력
</div>

지정한 날짜 범위에 대한 일별 캔들 가격 이력을 조회합니다.

```python theme={null}
data = fin.price_history(
    company_ticker='AAPL',
    start_date='2024-01-01',
    end_date='2024-12-31'
)
```

**파라미터:**

* `company_ticker` (필수) - 주식 티커
* `start_date` (필수) - YYYY-MM-DD 형식의 시작일
* `end_date` (필수) - YYYY-MM-DD 형식의 종료일

<div id="quote">
  #### 시세
</div>

OHLC, 매수/매도 호가, 거래량, 등락률을 포함한 실시간 시세 데이터를 조회합니다.

```python theme={null}
quote = fin.quote(company_ticker='AAPL')
```

**반환값:** Symbol, exchange, type, name, open, high, low, close, bid price, ask price, volume, change percent

<div id="chart">
  #### 차트
</div>

원하는 시간 간격으로 차트 데이터를 가져옵니다.

```python theme={null}
chart = fin.chart(
    company_ticker='AAPL',
    start_date='2024-01-01',
    end_date='2024-12-31',
    interval='1D'  # 선택 사항: 1MONTH, 1W, 1D, 1H, 15M
)
```

**간격 옵션:** `1MONTH`, `1W`, `1D`, `1H`, `15M`

<div id="auto-complete">
  #### 자동완성
</div>

유연한 검색 방식을 통해 기업 티커를 조회할 수 있습니다.

```python theme={null}
results = fin.auto_complete(
    company_ticker='AAPL',
    search_method='SYMBOL'  # 선택 사항: SYMBOL, SYMBOL_NAME, SYMBOL_WITHIN
)
```

<div id="fundamental-data">
  ### 기초 재무 데이터
</div>

<div id="fundamentals">
  #### 기초 재무 지표
</div>

기업의 포괄적인 기초 재무 지표를 조회합니다.

```python theme={null}
fundamentals = fin.fundamentals(
    company_ticker='AAPL',
    isin=None,  # 선택 사항
    cik=None,   # 선택 사항
    date=None   # 선택 사항: YYYY-MM-DD
)
```

<div id="financials">
  #### 재무제표
</div>

상세 재무제표에 액세스합니다.

```python theme={null}
financials = fin.financials(
    company_ticker='AAPL',
    isin=None,
    cik=None,
    date=None
)
```

<div id="valuation-ratios">
  #### Valuation Ratios
</div>

밸류에이션 지표와 비율 데이터를 가져옵니다.

```python theme={null}
valuation = fin.valuation_ratios(
    company_ticker='AAPL',
    isin=None,
    cik=None,
    date=None
)
```

<div id="earning-ratios">
  #### 수익성 비율
</div>

수익성 관련 비율 및 지표를 조회합니다.

```python theme={null}
earning_ratios = fin.earning_ratios(
    company_ticker='AAPL',
    isin=None,
    cik=None,
    date=None
)
```

<div id="operation-ratios">
  #### 운영 비율
</div>

운영 효율성 비율을 조회합니다.

```python theme={null}
operation_ratios = fin.operation_ratios(
    company_ticker='AAPL',
    isin=None,
    cik=None,
    date=None
)
```

<div id="corporate-events-calendar-data">
  ### 기업 이벤트 및 calendar 데이터
</div>

모든 calendar 메서드는 페이지네이션 및 필터링을 지원합니다.

```python theme={null}
# 배당
dividends = fin.dividends(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# 애널리스트 레이팅
ratings = fin.ratings(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# 실적
earnings = fin.earnings(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# 주식 분할
splits = fin.splits(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# 경제 지표
economics = fin.economics(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    importance=None
)

# 실적 가이던스
guidance = fin.guidance(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# IPO
ipos = fin.ipo(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# 개인투자자 활동
retail = fin.retail(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)

# 컨퍼런스 콜
conference_calls = fin.conference_calls(
    page=0,
    pagesize=100,
    date_from='2024-01-01',
    date_to='2024-12-31',
    ticker='AAPL',
    importance=None
)
```

<div id="company-information">
  ### 회사 정보
</div>

<div id="company-profile">
  #### 회사 프로필
</div>

상세한 회사 프로필 정보를 조회합니다.

```python theme={null}
profile = fin.company_profile(company_ticker='AAPL')
```

<div id="company">
  #### 회사
</div>

기본적인 회사 정보를 조회합니다.

```python theme={null}
company = fin.company(company_ticker='AAPL')
```

<div id="share-class">
  #### 주식 종류
</div>

주식 종류에 대한 세부 정보를 가져옵니다.

```python theme={null}
share_class = fin.share_class(company_ticker='AAPL')
```

<div id="earning-reports">
  #### 실적 보고서
</div>

과거 실적 보고서를 조회합니다.

```python theme={null}
earning_reports = fin.earning_reports(company_ticker='AAPL')
```

<div id="logos">
  #### 로고
</div>

선택적 필터를 사용하여 기업 로고를 조회합니다.

```python theme={null}
logos = fin.logos(
    ticker='AAPL',
    filters=None  # 선택 사항 필터
)
```

<div id="screening-analysis">
  ### 검색 및 분석
</div>

<div id="instruments">
  #### 인스트루먼트
</div>

섹터 및 시가총액 필터를 사용해 종목을 필터링합니다.

```python theme={null}
instruments = fin.instruments(
    sector=None,      # 선택 사항: 섹터 필터
    market_cap=None   # 선택 사항: 시가총액 필터
)
```

<div id="security">
  #### 증권
</div>

symbol, exchange, currency, CUSIP을 포함한 증권 상세 정보를 가져옵니다.

```python theme={null}
security = fin.security(company_ticker='AAPL')
```

<div id="movers">
  #### 시세 급변 종목
</div>

상승률·하락률 상위 종목을 조회합니다.

```python theme={null}
movers = fin.movers(
    session=None,  # 선택사항: pre, post, regular
    sector=None    # 선택사항 섹터 필터
)
```

<div id="ticker-detail">
  #### 티커 상세
</div>

주요 통계, 동종 업계 기업 정보 및 백분위(percentile) 데이터를 조회합니다.

```python theme={null}
detail = fin.ticker_detail(company_ticker='AAPL')
```

<div id="options-data">
  ### 옵션 데이터
</div>

<div id="options-activity">
  #### 옵션 거래 동향
</div>

옵션 거래 활동을 조회합니다.

```python theme={null}
options = fin.options_activity(
    company_ticker='AAPL',
    date_from='2024-01-01',  # 선택 사항
    date_to='2024-12-31',    # 선택 사항
    page=0,                   # 선택 사항
    pagesize=100             # 선택 사항
)
```

***

<div id="news-data-module">
  ## 뉴스 데이터 모듈
</div>

<div id="initialization">
  ### 초기화
</div>

```python theme={null}
from benzingaorg import news_data

news = news_data.News(api_key='YOUR_API_KEY')
```

<div id="news-methods">
  ### 뉴스 메서드
</div>

<div id="news">
  #### 뉴스
</div>

유연한 필터링 및 표시 옵션으로 뉴스 기사를 조회합니다.

```python theme={null}
articles = news.news(
    pagesize=15,              # 기본값: 15
    display_output='full',    # 옵션: full, abstract, headline
    date_from='2024-01-01',   # 선택사항
    date_to='2024-12-31',     # 선택사항
    channel=None              # 선택사항: 채널로 필터링
)
```

**표시 형식 옵션:**

* `full` - 전체 기사 내용
* `abstract` - 기사 요약
* `headline` - 헤드라인만

<div id="top-news">
  #### 주요 뉴스
</div>

인기 있는 뉴스 기사를 조회합니다.

```python theme={null}
top = news.top_news(
    type=None,      # 선택 사항: 뉴스 유형
    channel=None,   # 선택 사항: 채널 필터
    limit=10        # 반환할 기사 개수
)
```

<div id="channels">
  #### 채널
</div>

사용 가능한 뉴스 채널 목록을 반환합니다.

```python theme={null}
channels = news.channels()
```

**반환값:** 채널 이름과 ID

<div id="quantified-news">
  #### 정량 지표 뉴스
</div>

정량 지표가 포함된 뉴스 데이터를 가져올 수 있습니다.

```python theme={null}
quantified = news.quantified_news(
    page=0,
    pagesize=100,
    date_from='2024-01-01',  # 선택 사항
    date_to='2024-12-31'     # 선택 사항
)
```

**반환값:** 헤드라인, 거래량, 시가 갭, 변동 범위 지표 및 기타 정량 데이터

***

<div id="output-formatting">
  ## 출력 형식
</div>

두 모듈 모두 JSON 시각화를 개선하기 위해 `.output()` 메서드를 지원합니다.

```python theme={null}
# 금융 데이터 출력
data = fin.quote('AAPL')
fin.output(data)

# 뉴스 데이터 출력
articles = news.news(pagesize=10)
news.output(articles)
```

***

<div id="complete-example">
  ## 완전한 예제
</div>

```python theme={null}
from benzingaorg import financial_data, news_data

# 모듈 초기화
fin = financial_data.Benzinga(api_key='YOUR_API_KEY')
news = news_data.News(api_key='YOUR_API_KEY')

# 금융 데이터 가져오기
quote = fin.quote('AAPL')
fundamentals = fin.fundamentals('AAPL')
earnings = fin.earnings(ticker='AAPL', date_from='2024-01-01')

# 뉴스 데이터 가져오기
articles = news.news(pagesize=20, display_output='full')
top_news = news.top_news(limit=5)

# 포맷 지정 및 표시
fin.output(quote)
news.output(articles)
```

***

<div id="resources">
  ## 리소스
</div>

* **리포지토리**: [github.com/Benzinga/benzinga-python-client](https://github.com/Benzinga/benzinga-python-client)
* **라이선스**: MIT
* **API 키**: [cloud.benzinga.com](https://cloud.benzinga.com)

<div id="support">
  ## 지원
</div>

기술 지원 또는 API 키 발급이 필요할 경우 [cloud.benzinga.com](https://cloud.benzinga.com)을 통해 Benzinga에 문의하십시오.
