Documentation Index
Fetch the complete documentation index at: https://benzinga-2-locadex-parallel-main.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Benzinga Python SDK は、定量分析およびマーケットインテリジェンスのために、Benzinga の金融データおよびニュース API へ包括的にアクセスできる手段を提供します。SDK は金融データ用とニュースデータ用の 2 つの主要モジュールを備えており、開発者が高度な金融アプリケーションを構築できるようにします。
pip を使って SSH 経由で SDK をインストールします。
pip install git+ssh://git@github.com/Benzinga/benzinga-python-client.git
すべての SDK クラスでは、認証に API キーが必要です。API キーを取得するには、cloud.benzinga.com にアクセスしてください。
SDK は主に次の 2 つのモジュールで構成されています。
- Financial Data - 定量的な金融分析および市場データ
- News Data - 金融ニュース、ヘッドライン、および市場センチメント
from benzingaorg import financial_data
fin = financial_data.Benzinga(api_key='YOUR_API_KEY')
指定した日付範囲の過去の日次ローソク足データを取得します。
data = fin.price_history(
company_ticker='AAPL',
start_date='2024-01-01',
end_date='2024-12-31'
)
パラメータ:
company_ticker (必須) - 株式のtickerシンボル
start_date (必須) - 開始日(YYYY-MM-DD 形式)
end_date (必須) - 終了日(YYYY-MM-DD 形式)
OHLC、ビッド/アスク、出来高、変動率を含むリアルタイムのクォートデータを取得します。
quote = fin.quote(company_ticker='AAPL')
戻り値: symbol、exchange、type、name、open、high、low、close、bid価格、ask価格、出来高、変化率(%)
任意の時間間隔を指定してチャートデータを取得します。
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
柔軟な検索方法で企業ティッカーを検索できます。
results = fin.auto_complete(
company_ticker='AAPL',
search_method='SYMBOL' # オプション: SYMBOL, SYMBOL_NAME, SYMBOL_WITHIN
)
企業のファンダメンタルズデータを包括的に取得します。
fundamentals = fin.fundamentals(
company_ticker='AAPL',
isin=None, # 任意
cik=None, # 任意
date=None # 任意: YYYY-MM-DD
)
詳細な財務諸表データにアクセスできます。
financials = fin.financials(
company_ticker='AAPL',
isin=None,
cik=None,
date=None
)
Valuation Ratios(バリュエーション指標)
バリュエーション指標および各種レシオを取得します。
valuation = fin.valuation_ratios(
company_ticker='AAPL',
isin=None,
cik=None,
date=None
)
利益に関連する比率および指標を取得します。
earning_ratios = fin.earning_ratios(
company_ticker='AAPL',
isin=None,
cik=None,
date=None
)
経営効率に関する各種比率を取得します。
operation_ratios = fin.operation_ratios(
company_ticker='AAPL',
isin=None,
cik=None,
date=None
)
すべてのcalendarメソッドでページネーションとフィルタリングが利用できます。
# 配当
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
)
企業の詳細情報を取得します。
profile = fin.company_profile(company_ticker='AAPL')
企業に関する基本情報を取得します。
company = fin.company(company_ticker='AAPL')
株式クラスの詳細を取得します。
share_class = fin.share_class(company_ticker='AAPL')
過去の決算レポートを取得します。
earning_reports = fin.earning_reports(company_ticker='AAPL')
オプションのフィルタを指定して企業ロゴを取得します。
logos = fin.logos(
ticker='AAPL',
filters=None # オプションのフィルター
)
セクターおよび時価総額フィルターで銘柄をスクリーニングします。
instruments = fin.instruments(
sector=None, # セクターフィルター(オプション)
market_cap=None # 時価総額フィルター(オプション)
)
symbol、exchange、通貨、CUSIP を含む証券情報を取得します。
security = fin.security(company_ticker='AAPL')
上位の上昇銘柄と下落銘柄を取得します。
movers = fin.movers(
session=None, # オプション: pre, post, regular
sector=None # オプション: セクターフィルタ
)
主要な統計情報、同業他社情報、およびパーセンタイルデータを取得します。
detail = fin.ticker_detail(company_ticker='AAPL')
オプション取引の状況を取得します。
options = fin.options_activity(
company_ticker='AAPL',
date_from='2024-01-01', # 任意
date_to='2024-12-31', # 任意
page=0, # 任意
pagesize=100 # 任意
)
from benzingaorg import news_data
news = news_data.News(api_key='YOUR_API_KEY')
柔軟なフィルタリングと表示オプションでニュース記事を取得できます。
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 - 見出しのみ
注目度の高いニュース記事を取得します。
top = news.top_news(
type=None, # オプションのニュース種別
channel=None, # オプションのチャネルフィルタ
limit=10 # 返却する記事の件数
)
利用可能なニュースチャンネルの一覧を取得します。
channels = news.channels()
戻り値: チャンネル名とID
定量的な指標付きニュースデータを取得します。
quantified = news.quantified_news(
page=0,
pagesize=100,
date_from='2024-01-01', # 任意
date_to='2024-12-31' # 任意
)
戻り値: 見出し、出来高、寄り付きギャップ、レンジ関連指標などの定量データ
どちらのモジュールでも、JSON 表示を見やすくするための .output() メソッドがサポートされています。
# 財務データ出力
data = fin.quote('AAPL')
fin.output(data)
# ニュースデータ出力
articles = news.news(pagesize=10)
news.output(articles)
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)
技術的なサポートおよび API キーの発行については、cloud.benzinga.com より Benzinga までお問い合わせください。