Skip to content

feat: add ClientV2.get_fin_earnings_date() for /fins/earnings-date - #121

Merged
s-meitoma merged 1 commit into
J-Quants:mainfrom
shigechika:feat/fin-earnings-date
Aug 7, 2026
Merged

feat: add ClientV2.get_fin_earnings_date() for /fins/earnings-date#121
s-meitoma merged 1 commit into
J-Quants:mainfrom
shigechika:feat/fin-earnings-date

Conversation

@shigechika

Copy link
Copy Markdown
Contributor

Closes #120

概要

2026-08-03 に追加された決算発表予定日API(/fins/earnings-date仕様)に対応する ClientV2.get_fin_earnings_date() を追加します。

既存の get_eq_earnings_cal()/equities/earnings-calendar、3・9月期決算会社限定・現在の表示名は「決算発表予定日(3・9月期決算会社のみ)」)とは別のエンドポイントです。新APIは決算期によらず全上場銘柄(REIT等含む)が対象で、予定日の変更・未定の履歴も公表日単位で追跡できます。

実装

  • FinEarningsDateApiV2jquantsapi/apis/v2/fins.py)をFinDividendApiV2と同じ構成で追加(共通ヘルパー_get_paginatedを使用。仕様上pagination_keyのみでcursor差分取得の記載が無いため、FinSummaryApiV2型のcursor対応は行っていません)
  • FIN_EARNINGS_DATE_COLUMNS_V2jquantsapi/constants.py
  • ClientV2.get_fin_earnings_date(code, date_yyyymmdd, scheduled_date)

code/date_yyyymmdd/scheduled_dateは仕様上いずれか1つの指定必須(同時指定はAPI側で400エラー)ですが、クライアント側では他の既存メソッド(get_fin_summary等)と同様、渡された値をそのまま転送するだけで排他性の検証はAPI側に委ねています。

検証

  • 実データで動作確認済み(code="86970"date="20260803"いずれも仕様通りのフィールドが返る)
  • 新規テスト4本(パラメータ透過・DataFrame列/型・SchDate空文字→NaT変換・空結果)追加、既存57件と合わせて全61件パス
  • black/isort/flake8/mypy 全てクリーン

🤖 Generated with Claude Code

J-Quants released a new all-issue earnings-announcement-date API on
2026-08-03 (https://jpx-jquants.com/ja/spec/fin-earnings-date),
distinct from the existing get_eq_earnings_cal() (/equities/earnings-calendar,
limited to March/September fiscal-year-end companies, now renamed). The
new endpoint covers every listed issuer (including REITs) and tracks
schedule-change history by publication date.

Adds FinEarningsDateApiV2 (jquantsapi/apis/v2/fins.py) following the
FinDividendApiV2 pattern (uses the shared _get_paginated helper; no
cursor differential-fetch, matching the endpoint's spec which only
documents pagination_key), FIN_EARNINGS_DATE_COLUMNS_V2 in constants.py,
and ClientV2.get_fin_earnings_date(code, date_yyyymmdd, scheduled_date).

Verified against the live API with the patched client (code="86970"
and date="20260803" both return the documented PubDate/SchDate/FQName/
FYE/Code/CoName/CoNameEn fields). Tests cover parameter passthrough,
DataFrame shape/dtypes, the empty-SchDate-becomes-NaT case (an
undetermined schedule per the spec), and the empty-result case.
@shigechika
shigechika requested a review from s-meitoma as a code owner August 5, 2026 10:48

@s-meitoma s-meitoma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらにつきましてもありがとうございます。LGTMでしたので、マージさせていただきます。

@s-meitoma
s-meitoma added this pull request to the merge queue Aug 7, 2026
Merged via the queue into J-Quants:main with commit 244c420 Aug 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

決算発表予定日API(/fins/earnings-date)がクライアントに未実装

2 participants