jquants-cli-usage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

J-Quants CLI 使用スキル

J-Quants CLI Usage Guide

Role & Decision Flow

Role & Decision Flow

jquants コマンドを構築するときは、以下の順序で判断する:
  1. データ種別を決める — 株式(eq)・市場(mkt)・デリバティブ(deriv)・財務(fins)・指数(idx)
  2. プラン制限を確認する — ユーザーのプランで利用可能か確認する(下記「Subscription Plans & API Availability」参照)。プランが不明な場合は、コマンドを提示しつつ必要プランを明記する
  3. フィールド名を確認する
    -f
    で絞り込む前に
    jquants schema <endpoint>
    で正確な名前を調べる(推測しない)
  4. 個別API vs バルクを選ぶ — 「全銘柄」「1ヶ月以上」「大量」のいずれかに該当 → バルク(references/commands-bulk.md 参照)。個別APIを大量に繰り返すとレートリミットに抵触するため(下記 Rate Limits 参照)。Free プランは CSV/バルク不可
    mkt calendar
    を除く)
  5. コマンドを組み立てる — グローバルオプション(
    --output
    ,
    --save
    ,
    -f
    )をサブコマンドの前に置く
  6. パイプを考慮する — パイプ先がある場合は
    --output
    を省略するだけで自動的に CSV が流れる
When building jquants commands, make judgments in the following order:
  1. Determine data type — Equities (eq), Market (mkt), Derivatives (deriv), Finance (fins), Index (idx)
  2. Check plan restrictions — Confirm whether it is available under the user's plan (refer to "Subscription Plans & API Availability" below). If the plan is unknown, present the command and clearly state the required plan
  3. Check field names — Before filtering with
    -f
    , check the exact name with
    jquants schema <endpoint>
    (do not guess)
  4. Choose between individual API and bulk — If it falls into any of "all tickers", "over 1 month", "large volume" → Use bulk (refer to references/commands-bulk.md). Repeated calls to individual APIs in large quantities will hit rate limits (refer to Rate Limits below). Free plan does not support CSV/bulk download (except
    mkt calendar
    )
  5. Assemble the command — Place global options (
    --output
    ,
    --save
    ,
    -f
    ) before subcommands
  6. Consider pipes — If there is a pipe destination, just omit
    --output
    and CSV will be streamed automatically

Prerequisites

Prerequisites

推奨:
jquants login
でブラウザログイン(API キーを自動取得・保存)
sh
jquants login   # ブラウザが開き、Cognito OAuth2 PKCE でログイン
                # → ~/.config/jquants/credentials.json に API キーを自動保存
フォールバック: 環境変数で直接指定
sh
export JQUANTS_API_KEY="your-api-key"
Recommended: Log in via browser with
jquants login
(API key is automatically obtained and saved)
sh
jquants login   # Browser opens, log in with Cognito OAuth2 PKCE
                # → API key is automatically saved to ~/.config/jquants/credentials.json
Fallback: Specify directly via environment variables
sh
export JQUANTS_API_KEY="your-api-key"

または .env ファイルに記載

Or write it in the .env file


**認証優先順位:** `~/.config/jquants/credentials.json` の api_key → `JQUANTS_API_KEY` 環境変数 → エラー(`jquants login` を促す)

> **`jquants schema` は認証不要。**ログイン前でもフィールド名の確認に使える。

**Authentication priority:** api_key in `~/.config/jquants/credentials.json` → `JQUANTS_API_KEY` environment variable → Error (prompt to run `jquants login`)

> **`jquants schema` does not require authentication.** It can be used to check field names even before logging in.

Command Syntax Rules

Command Syntax Rules

グローバルオプション (
--output
,
--save
,
-f
) はサブコマンドの前に置く:
sh
undefined
Global options (
--output
,
--save
,
-f
) must be placed before subcommands:
sh
undefined

✅ 正しい

✅ Correct

jquants --output csv --save out.csv eq daily --code 86970
jquants --output csv --save out.csv eq daily --code 86970

❌ 誤り(サブコマンド後は無効)

❌ Incorrect (invalid after subcommand)

jquants eq daily --code 86970 --output csv

> **なぜ:** clap の設計上、サブコマンド以降のフラグはサブコマンド自身のオプションとして解析される。サブコマンドの後に置くと「不明なフラグ」エラーになる。

**パイプ時の自動CSV切替:**

stdout が TTY でない場合(パイプ先がある場合)、`--output table`(デフォルト)は自動的にCSV形式で出力される。

```sh
jquants eq daily --code 86970 --output csv

> **Reason:** Due to clap's design, flags after a subcommand are parsed as options of the subcommand itself. Placing them after the subcommand will cause an "unknown flag" error.

**Automatic CSV switching when piping:**

When stdout is not a TTY (when there is a pipe destination), the default `--output table` will automatically output in CSV format.

```sh

パイプすると自動でCSVが流れる

Automatically streams CSV when piped

jquants eq daily --code 86970 | head -5
jquants eq daily --code 86970 | head -5

明示的にJSONをパイプしたい場合は指定が必要

Explicit specification is required if you want to pipe JSON

jquants --output json eq daily --code 86970 | jq '.[] | .AdjustmentClose'

**フィールド選択 (`--fields` / `-f`) でカラムを絞り込む:**

```sh
jquants --output json eq daily --code 86970 | jq '.[] | .AdjustmentClose'

**Filter columns with field selection (`--fields` / `-f`):**

```sh

日付・コード・調整済終値だけを取得

Get only date, code, adjusted close price

jquants -f Date,Code,AdjustmentClose eq daily --code 86970
jquants -f Date,Code,AdjustmentClose eq daily --code 86970

不正なフィールド名を指定するとエラーで利用可能フィールド一覧が表示される

If an invalid field name is specified, an error will be displayed with a list of available fields

undefined
undefined

Schema-First: フィールド名の確認

Schema-First: Check field names

--fields
でカラムを絞り込む前に、
jquants schema <endpoint>
で正確なフィールド名を確認する。フィールド名を推測しない(PascalCase が多いが一致しないことがある)。
sh
jquants schema                  # 全エンドポイント一覧(キー・説明・フィールド数)
jquants schema eq.daily         # eq.daily の全フィールド(名前・型・説明)
jquants --output json schema    # JSON 形式で出力
エンドポイントキーは
カテゴリ.コマンド
形式(例:
eq.daily
,
fins.summary
,
mkt.short-ratio
)。
手順:
  1. jquants schema eq.daily
    でフィールド一覧を取得
  2. 必要なフィールド名をコピーして
    -f
    に指定
  3. 不正なフィールド名はエラーで拒否される(利用可能フィールド一覧が表示される)
Before filtering columns with
--fields
, confirm the exact field name with
jquants schema <endpoint>
. Do not guess field names (most are PascalCase, but there may be inconsistencies).
sh
jquants schema                  # List of all endpoints (key, description, number of fields)
jquants schema eq.daily         # All fields of eq.daily (name, type, description)
jquants --output json schema    # Output in JSON format
Endpoint keys are in the format
category.command
(e.g.
eq.daily
,
fins.summary
,
mkt.short-ratio
).
Steps:
  1. Get the list of fields with
    jquants schema eq.daily
  2. Copy the required field names and specify them with
    -f
  3. Invalid field names will be rejected with an error (list of available fields will be displayed)

Quick Reference

Quick Reference

認証 & ユーティリティ

Authentication & Utilities

やりたいことコマンド
ログイン(初回セットアップ)
jquants login
ログアウト
jquants logout
API フィールド一覧を確認
jquants schema
特定エンドポイントのフィールド詳細
jquants schema eq.daily
What you want to doCommand
Log in (first time setup)
jquants login
Log out
jquants logout
Check API field list
jquants schema
Field details for specific endpoint
jquants schema eq.daily

株式データ(eq)

Equities Data (eq)

やりたいことコマンド更新時刻
全銘柄マスタ
jquants eq master
日次 17:30頃
株価四本値
jquants eq daily
日次 16:30頃
前場四本値
jquants eq am
日次 12:00頃
分足データ
jquants eq minute
日次 16:30頃
投資部門別売買状況
jquants eq investor-types
週次(木) 18:00頃
決算発表予定日
jquants eq earnings-calendar
不定期 19:00頃
株価ティック
jquants eq trades
日次 16:30頃
What you want to doCommandUpdate Time
All ticker master
jquants eq master
Around 17:30 daily
Stock price OHLCV
jquants eq daily
Around 16:30 daily
Morning session OHLCV
jquants eq am
Around 12:00 daily
Minute bar data
jquants eq minute
Around 16:30 daily
Trading status by investor sector
jquants eq investor-types
Weekly (Thursday) around 18:00
Earnings announcement scheduled date
jquants eq earnings-calendar
Irregular around 19:00
Stock price tick data
jquants eq trades
Around 16:30 daily

市場データ(mkt)

Market Data (mkt)

やりたいことコマンド更新時刻
売買内訳
jquants mkt breakdown
日次 18:00頃
日々公表信用残
jquants mkt margin-alert
日次 16:30頃
信用週末残高
jquants mkt margin-interest
週次(火) 16:30頃
取引カレンダー
jquants mkt calendar
不定期
業種別空売り比率
jquants mkt short-ratio
日次 16:30頃
空売り残高報告
jquants mkt short-sale-report
日次 17:30頃
What you want to doCommandUpdate Time
Trading breakdown
jquants mkt breakdown
Around 18:00 daily
Daily published margin balance
jquants mkt margin-alert
Around 16:30 daily
Weekend margin balance
jquants mkt margin-interest
Weekly (Tuesday) around 16:30
Trading calendar
jquants mkt calendar
Irregular
Short selling ratio by industry
jquants mkt short-ratio
Around 16:30 daily
Short selling balance report
jquants mkt short-sale-report
Around 17:30 daily

デリバティブ(deriv)

Derivatives (deriv)

やりたいことコマンド更新時刻
先物四本値
jquants deriv futures
日次 27:00頃
オプション四本値
jquants deriv options
日次 27:00頃
日経225オプション
jquants deriv options-225
日次 27:00頃
What you want to doCommandUpdate Time
Futures OHLCV
jquants deriv futures
Around 27:00 daily
Options OHLCV
jquants deriv options
Around 27:00 daily
Nikkei 225 options
jquants deriv options-225
Around 27:00 daily

財務データ(fins)

Financial Data (fins)

やりたいことコマンド更新時刻
財務諸表
jquants fins details
日次 18:00頃(速報) / 24:30頃(確報)
配当金情報
jquants fins dividend
日次 12〜19時頃
財務情報サマリー
jquants fins summary
日次 18:00頃(速報) / 24:30頃(確報)
What you want to doCommandUpdate Time
Financial statements
jquants fins details
Around 18:00 daily (flash) / around 24:30 (final)
Dividend information
jquants fins dividend
Around 12:00~19:00 daily
Financial information summary
jquants fins summary
Around 18:00 daily (flash) / around 24:30 (final)

指数データ(idx)

Index Data (idx)

やりたいことコマンド更新時刻
TOPIX指数四本値
jquants idx daily-topix
日次 16:30頃
指数四本値
jquants idx daily
日次 16:30頃
What you want to doCommandUpdate Time
TOPIX index OHLCV
jquants idx daily-topix
Around 16:30 daily
Index OHLCV
jquants idx daily
Around 16:30 daily

Category Reference Files

Category Reference Files

各カテゴリの詳細なコマンド構文・フラグ・例はリファレンスファイルに記載されている。Quick Reference の情報で十分な場合はリファレンスを読む必要はない。
以下の場合にリファレンスを参照する:
カテゴリリファレンス参照すべき場面
eqreferences/commands-eq.md銘柄コード・日付・期間フィルタ、
eq trades
の特殊動作
mktreferences/commands-mkt.md
--s33
,
--disc-date
/
--calc-date
等の特殊フラグ
derivreferences/commands-deriv.md
--category
,
--contract-flag
の使い方
finsreferences/commands-fins.md
fins details
の FS フィールド(JSON出力必須)
idxreferences/commands-idx.md指数コード指定・TOPIX
bulkreferences/commands-bulk.mdバルクDLの判断基準・ワークフロー・エンドポイント一覧
plansreferences/plans.mdプラン別 API 可否・取得可能期間・アドオン情報
schedulereferences/data-update-schedule.mdデータの鮮度判断・更新タイミングの詳細・シナリオ別の判断例が必要なとき
Detailed command syntax, flags and examples for each category are described in the reference files. If the information in Quick Reference is sufficient, you do not need to read the references.
Refer to the references in the following cases:
CategoryReferenceScenarios to refer
eqreferences/commands-eq.mdTicker code/date/period filters, special behavior of
eq trades
mktreferences/commands-mkt.mdSpecial flags such as
--s33
,
--disc-date
/
--calc-date
derivreferences/commands-deriv.mdUsage of
--category
,
--contract-flag
finsreferences/commands-fins.mdFS field of
fins details
(JSON output required)
idxreferences/commands-idx.mdIndex code specification, TOPIX
bulkreferences/commands-bulk.mdJudgment criteria, workflow, endpoint list for bulk download
plansreferences/plans.mdAPI availability, obtainable period, add-on information by plan
schedulereferences/data-update-schedule.mdWhen you need data freshness judgment, detailed update timing, scenario-based judgment examples

Output, Fields, and Save

Output, Fields, and Save

sh
undefined
sh
undefined

出力形式: table(デフォルト)、json、csv、parquet

Output formats: table (default), json, csv, parquet

jquants --output json eq master jquants --output csv eq master jquants --output parquet --save master.parquet eq master # Parquet は --save 必須
jquants --output json eq master jquants --output csv eq master jquants --output parquet --save master.parquet eq master # --save is required for Parquet

ファイル保存(--save は --output table と併用不可)

Save file (--save cannot be used with --output table)

jquants --output csv --save master.csv eq master jquants --output json --save daily.json eq daily --code 86970
jquants --output csv --save master.csv eq master jquants --output json --save daily.json eq daily --code 86970

フィールド選択: -f でカラムを絞り込み(全形式で有効)

Field selection: filter columns with -f (valid for all formats)

jquants -f Date,Code,AdjustmentClose eq daily --code 86970 jquants --output csv -f Date,Code,AdjustmentClose --save daily.csv eq daily --code 86970
jquants -f Date,Code,AdjustmentClose eq daily --code 86970 jquants --output csv -f Date,Code,AdjustmentClose --save daily.csv eq daily --code 86970

パイプでデータを加工

Process data with pipes

jquants eq daily --code 86970 | head -5 # 自動CSV jquants --output json eq daily --code 86970 | jq '.[0]' # JSON明示
undefined
jquants eq daily --code 86970 | head -5 # Automatic CSV jquants --output json eq daily --code 86970 | jq '.[0]' # Explicit JSON
undefined

Workflow Recipes

Workflow Recipes

特定銘柄の株価トレンド分析

Stock price trend analysis for specific ticker

sh
undefined
sh
undefined

1. 銘柄コードを確認

1. Confirm ticker code

jquants eq master --code 72030
jquants eq master --code 72030

2. フィールド名を確認

2. Confirm field names

jquants schema eq.daily
jquants schema eq.daily

3. 過去3ヶ月の日次データを CSV で保存

3. Save daily data for the past 3 months as CSV

jquants --output csv --save toyota.csv
-f Date,AdjustmentClose,Volume
eq daily --code 72030 --from 2026-01-01 --to 2026-03-31
undefined
jquants --output csv --save toyota.csv
-f Date,AdjustmentClose,Volume
eq daily --code 72030 --from 2026-01-01 --to 2026-03-31
undefined

全銘柄の月次データ取得(バルク)

Obtain monthly data for all tickers (bulk)

sh
undefined
sh
undefined

個別APIでループしない。全銘柄は bulk を使う。

Do not loop with individual APIs. Use bulk for all tickers.

jquants bulk get --endpoint /equities/bars/daily --date 2026-03 --download
jquants bulk get --endpoint /equities/bars/daily --date 2026-03 --download

解凍して CSV として利用

Decompress and use as CSV

gunzip *.gz
undefined
gunzip *.gz
undefined

財務情報の取得

Obtain financial information

sh
undefined
sh
undefined

配当情報(期間指定)

Dividend information (period specified)

jquants --output csv --save div.csv fins dividend --from 2026-01-01 --to 2026-03-31
jquants --output csv --save div.csv fins dividend --from 2026-01-01 --to 2026-03-31

財務サマリー(銘柄指定、JSON推奨)

Financial summary (ticker specified, JSON recommended)

jquants --output json fins summary --code 86970
jquants --output json fins summary --code 86970

財務諸表の完全データ(FS フィールドは JSON 必須)

Complete financial statement data (JSON required for FS field)

jquants --output json fins details --code 86970
undefined
jquants --output json fins details --code 86970
undefined

Special Behaviors

Special Behaviors

eq trades はバルク API を内部的に使用する

eq trades uses bulk API internally

eq trades
は他の
eq
コマンドと異なり、内部で
/equities/trades
のバルク API を呼び出す。そのため:
  • --code
    フラグは使用不可
  • --date YYYY-MM
    形式の月指定が可能(個別 API の
    YYYY-MM-DD
    とは異なる)
  • --download
    フラグでファイルをカレントディレクトリに保存する
sh
jquants eq trades --date 2025-12             # URL取得のみ
jquants eq trades --date 2025-12 --download  # ファイルダウンロード
Unlike other
eq
commands,
eq trades
internally calls the bulk API of
/equities/trades
. Therefore:
  • --code
    flag is not available
  • Month specification in
    --date YYYY-MM
    format is supported (different from
    YYYY-MM-DD
    for individual APIs)
  • Save files to current directory with
    --download
    flag
sh
jquants eq trades --date 2025-12             # Get URL only
jquants eq trades --date 2025-12 --download  # Download file

fins details の FS フィールド

FS field of fins details

fins details
の FS(Financial Statement)フィールドはネストされた JSON オブジェクト。テーブル表示では
"N items"
と省略される。完全なデータを取得するには
--output json
を使う。
The FS (Financial Statement) field of
fins details
is a nested JSON object. It is abbreviated as
"N items"
in table view. Use
--output json
to get complete data.

deriv の --contract-flag

--contract-flag of deriv

--contract-flag 1
は中心限月(最も取引が活発な限月)のみを取得する。省略すると全限月のデータが返る。
deriv futures
deriv options
の両方で使用可能。
--contract-flag 1
only gets the front month (the most actively traded contract month). If omitted, data for all contract months will be returned. Available for both
deriv futures
and
deriv options
.

Rate Limits

Rate Limits

J-Quants API はプランごとに1分あたりのリクエスト上限が設定されている。上限を意識してコマンドを設計することで、不要な遮断を避けられる。
J-Quants API has a request limit per minute for each plan. Design commands with the limit in mind to avoid unnecessary blocking.

プラン別上限(リクエスト/分)

Limit by plan (requests/minute)

プラン上限
Free5
Light60
Standard120
Premium500
PlanLimit
Free5
Light60
Standard120
Premium500

アドオン別上限(プランとは独立して適用)

Limit by add-on (applied independently of the plan)

アドオン上限
株価 分足・ティック60
Add-onLimit
Stock minute bar/tick data60

制限超過時の挙動

Behavior when limit is exceeded

  • HTTP
    429 Too Many Requests
    が返される
  • 大幅超過が続くと約5分間アクセスが完全遮断される(即時リトライは逆効果)
  • HTTP
    429 Too Many Requests
    is returned
  • If the limit is significantly exceeded continuously, access will be completely blocked for about 5 minutes (immediate retry is counterproductive)

回避のポイント

Avoidance tips

  • 全銘柄 × 全日付の個別ループは使わない
    bulk get
    で1リクエスト・全銘柄を一括取得する
  • 429 を受けたら即時リトライしない — しばらく待機(数十秒〜数分)してから再試行する
  • クエリパラメータで絞り込む — 不要なフィールドや日付範囲を減らし、1リクエストで必要なデータを取り切る
  • Do not use individual loops for all tickers × all dates — Use
    bulk get
    to get all tickers in one request
  • Do not retry immediately after receiving 429 — Wait for a while (tens of seconds to minutes) before retrying
  • Filter with query parameters — Reduce unnecessary fields and date ranges, get all required data in one request

Subscription Plans & API Availability

Subscription Plans & API Availability

各 API はプランによってアクセス可否と取得可能期間が異なる。コマンドを提案する前にプランの制限を確認する。プランが不明な場合は、コマンドを提示しつつ必要プランを明記する。
Accessibility and obtainable data period of each API vary by plan. Check plan restrictions before proposing commands. If the plan is unknown, present the command and clearly state the required plan.

最低必要プラン早見表

Quick reference of minimum required plan

最低必要プランCLI コマンド
Free
eq master
,
eq daily
,
eq earnings-calendar
,
fins summary
,
mkt calendar
Light
eq investor-types
,
idx daily-topix
Standard
mkt margin-interest
,
mkt short-ratio
,
mkt short-sale-report
,
mkt margin-alert
,
idx daily
,
deriv options-225
Premium
eq am
,
fins details
,
fins dividend
,
mkt breakdown
,
deriv futures
,
deriv options
Add-on
eq minute
,
eq trades
(分足・ティック専用アドオン契約が必要)
プラン階層: Free < Light < Standard < Premium(上位プランは下位の全 API を含む)
Free プランの制限: CSV/バルクダウンロード不可(
mkt calendar
を除く)。API アクセスのみ。データは「12週間前〜2年12週間前」のウィンドウに限定(最新12週と2年超の過去データは取得不可)。
詳細な取得可能期間・データ範囲は references/plans.md を参照。
Minimum required planCLI command
Free
eq master
,
eq daily
,
eq earnings-calendar
,
fins summary
,
mkt calendar
Light
eq investor-types
,
idx daily-topix
Standard
mkt margin-interest
,
mkt short-ratio
,
mkt short-sale-report
,
mkt margin-alert
,
idx daily
,
deriv options-225
Premium
eq am
,
fins details
,
fins dividend
,
mkt breakdown
,
deriv futures
,
deriv options
Add-on
eq minute
,
eq trades
(requires separate minute bar/tick data add-on subscription)
Plan hierarchy: Free < Light < Standard < Premium (higher plans include all APIs of lower plans)
Free plan restrictions: CSV/bulk download is not supported (except
mkt calendar
). Only API access is allowed. Data is limited to the window "12 weeks ago to 2 years and 12 weeks ago" (latest 12 weeks and historical data older than 2 years cannot be obtained).
Refer to references/plans.md for detailed obtainable periods and data ranges.

Data Freshness(更新タイミング)

Data Freshness (Update Timing)

J-Quants API のデータは市場イベント後に順次更新される。現在時刻と更新時刻の関係によって取得できるデータの鮮度が変わる。
J-Quants API data is updated sequentially after market events. The freshness of obtainable data changes depending on the relationship between current time and update time.

時間帯別更新サマリー(JST)

Update summary by time zone (JST)

更新時刻目安反映されるデータ
〜12:00前場四本値(
eq am
)が当日分に更新
〜16:30株価四本値・分足・ティック・指数・空売り比率・信用残(日次)が当日分に更新
〜17:30銘柄マスタ・空売り残高報告が更新
〜18:00売買内訳・投資部門別(週次)・財務情報(速報)が更新
〜19:00決算発表予定日が更新(不定期・JPX連動)
〜24:30財務情報(確報)・財務諸表(確報)が更新
〜27:00デリバティブ(先物・オプション)が当日分に更新(27:00 = 翌日3:00 AM)
Estimated update timeReflected data
~12:00Morning session OHLCV (
eq am
) updated for the current day
~16:30Stock price OHLCV, minute bars, tick data, indices, short selling ratios, daily margin balances updated for the current day
~17:30Ticker master, short selling balance report updated
~18:00Trading breakdown, investor sector data (weekly), financial information (flash) updated
~19:00Earnings announcement scheduled date updated (irregular, linked to JPX)
~24:30Financial information (final), financial statements (final) updated
~27:00Derivatives (futures, options) updated for the current day (27:00 = 3:00 AM next day)

エージェント判断の指針

Guidelines for agent judgment

  • 更新時刻前に当日データを聞かれた場合: 「○○:○○頃に当日分が反映されます。現時点では前営業日のデータが最新です」と伝える
  • 週次データ(信用週末残高・投資部門別): 信用残は火曜16:30、投資部門別は木曜18:00が更新目安。それ以外の曜日は前週分が最新
  • デリバティブは27:00(翌日3:00 AM)更新: 翌営業日の早朝にならないと前日分が揃わない
  • 「データが古い」と言われたとき: 更新時刻・週次サイクル・休祝日・プランの期間制限を順に確認する
詳細な判断フローとシナリオ例は references/data-update-schedule.md を参照。
  • When asked for current day data before the update time: Inform the user that "The current day's data will be reflected around XX:XX. At present, the latest data is from the previous business day."
  • Weekly data (weekend margin balance, investor sector data): Margin balance is updated around 16:30 on Tuesday, investor sector data around 18:00 on Thursday. For other days of the week, the latest data is from the previous week.
  • Derivatives are updated at 27:00 (3:00 AM next day): The previous day's data will not be available until early morning of the next business day.
  • When the user says "data is outdated": Check update time, weekly cycle, holidays, plan period restrictions in order.
Refer to references/data-update-schedule.md for detailed judgment flow and scenario examples.

Common Pitfalls

Common Pitfalls

誤り正しい書き方なぜ
eq daily --code X --output csv
--output csv eq daily --code X
clap がサブコマンド後のフラグをサブコマンドのオプションとして解析するため
--save out.csv eq daily
(output 未指定)
--output csv --save out.csv eq daily
table 形式は
--save
非対応。保存には csv/json/parquet を明示する
mkt short-ratio --code 0050
mkt short-ratio --s33 0050
short-ratio は銘柄ではなく33業種分類でフィルタする API 設計のため
mkt short-sale-report --date 2024-08-01
--disc-date
または
--calc-date
を使う
公表日と計算日は別概念。
--date
フラグは存在しない
eq daily --date 2026-03
(月のみ)
--date
は YYYY-MM-DD 形式
月指定は bulk 系のみ対応。個別 API は日単位
全銘柄ループで
eq daily --code X
を繰り返す
bulk get --endpoint /equities/bars/daily --date YYYY-MM --download
API rate limit 回避 & 効率。1ファイルで全銘柄取得可能
--output parquet eq daily
--save
未指定)
--output parquet --save out.parquet eq daily
Parquet はストリーミング出力できないため、ファイル保存が必須
-f date,code
(小文字のフィールド名)
-f Date,Code
jquants schema <endpoint>
で確認)
API フィールド名は PascalCase。大文字小文字を区別する
fins details
でテーブル表示すると FS が
"N items"
になる
--output json fins details
を使う
FS フィールドはネストされた JSON オブジェクト。テーブル表示では要約される
429 を受けてすぐリトライする数十秒〜数分待機してから再試行する大幅超過が続くと約5分間遮断される。即時リトライは遮断を長引かせる
Free プランで
bulk get
--output csv
を使う
個別 API(
eq daily --code X
)を使う、または上位プランへアップグレードを促す
Free プランは CSV/バルクダウンロード非対応(
mkt calendar
を除く)。API のみ利用可能
Light プランで
idx daily
deriv options-225
を使う
Standard プランが必要である旨を伝えるStandard 以上が必要な API。プランとコマンドの対応は references/plans.md を参照
16:00に
eq daily
で「今日の株価」を取得して最新と思い込む
「16:30頃に当日分が反映されます。現時点では前営業日のデータです」と伝える株価四本値は16:30頃に当日分が更新される。更新前は前営業日のデータが最新
月曜朝に
mkt margin-interest
を取得して先週分と思い込む
前々週金曜時点のデータ。火曜16:30以降に前週金曜分が反映されると伝える信用週末残高は第2営業日(通常火曜)16:30頃に更新される週次データ
MistakeCorrect writingReason
eq daily --code X --output csv
--output csv eq daily --code X
clap parses flags after the subcommand as options of the subcommand itself
--save out.csv eq daily
(output not specified)
--output csv --save out.csv eq daily
Table format does not support
--save
. Explicitly specify csv/json/parquet for saving
mkt short-ratio --code 0050
mkt short-ratio --s33 0050
short-ratio API is designed to filter by 33 industry classification, not by ticker
mkt short-sale-report --date 2024-08-01
Use
--disc-date
or
--calc-date
Announcement date and calculation date are separate concepts.
--date
flag does not exist
eq daily --date 2026-03
(month only)
--date
uses YYYY-MM-DD format
Month specification is only supported for bulk APIs. Individual APIs use daily units
Repeatedly run
eq daily --code X
in a loop for all tickers
bulk get --endpoint /equities/bars/daily --date YYYY-MM --download
Avoid API rate limit & improve efficiency. All tickers can be obtained in one file
--output parquet eq daily
(
--save
not specified)
--output parquet --save out.parquet eq daily
Parquet does not support streaming output, so file saving is required
-f date,code
(lowercase field names)
-f Date,Code
(check with
jquants schema <endpoint>
)
API field names are PascalCase and case-sensitive
FS becomes
"N items"
when displaying
fins details
in table view
Use
--output json fins details
FS field is a nested JSON object, which is summarized in table view
Retry immediately after receiving 429Wait for tens of seconds to minutes before retryingContinuous excessive exceeding will result in about 5 minutes of blocking. Immediate retry prolongs the blocking period
Use
bulk get
or
--output csv
with Free plan
Use individual APIs (
eq daily --code X
), or prompt to upgrade to a higher plan
Free plan does not support CSV/bulk download (except
mkt calendar
). Only API access is available
Use
idx daily
or
deriv options-225
with Light plan
Inform the user that Standard plan is requiredThese APIs require Standard or higher plan. Refer to references/plans.md for plan and command correspondence
Assume that the "today's stock price" obtained with
eq daily
at 16:00 is the latest
Inform the user that "The current day's data will be reflected around 16:30. At present, the latest data is from the previous business day."Stock price OHLCV is updated for the current day around 16:30. Before update, the latest data is from the previous business day
Assume that the
mkt margin-interest
obtained on Monday morning is from last week
Inform the user that it is data as of Friday of the week before last. The data for last Friday will be reflected after 16:30 on TuesdayWeekend margin balance is weekly data updated around 16:30 on the 2nd business day (usually Tuesday)