Loading...
Loading...
Build and execute commands to obtain Japanese stock market data with J-Quants CLI (jquants). It supports acquisition of stock prices, OHLCV candlesticks, minute bars, tick data, margin trading balances, short selling ratios, futures, options, financial statements, dividends, TOPIX and index data. It also supports checking API availability and obtainable data periods (Free/Light/Standard/Premium) for each plan. Triggers: jquants, J-Quants, stock price, stock price data, ticker, OHLCV, minute bar, JPX, TSE, TOPIX, Nikkei 225, futures, options, derivatives, short selling, margin trading, dividend, financial statements, financial results, PER, PBR, ROE, index, bulk download, Japanese stock, market data, subscription, plan, data range, API availability, update time, data update, update timing, outdated data, latest data, data freshness, update schedule
npx skill4agent add j-quants/jquants-cli jquants-cli-usage-fjquants schema <endpoint>mkt calendar--output--save-f--outputjquants loginjquants login # Browser opens, log in with Cognito OAuth2 PKCE
# → API key is automatically saved to ~/.config/jquants/credentials.jsonexport JQUANTS_API_KEY="your-api-key"
# Or write it in the .env file~/.config/jquants/credentials.jsonJQUANTS_API_KEYjquants logindoes not require authentication. It can be used to check field names even before logging in.jquants schema
--output--save-f# ✅ Correct
jquants --output csv --save out.csv eq daily --code 86970
# ❌ Incorrect (invalid after subcommand)
jquants eq daily --code 86970 --output csvReason: 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.
--output table# Automatically streams CSV when piped
jquants eq daily --code 86970 | head -5
# Explicit specification is required if you want to pipe JSON
jquants --output json eq daily --code 86970 | jq '.[] | .AdjustmentClose'--fields-f# Get only date, code, adjusted close price
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--fieldsjquants schema <endpoint>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 formatcategory.commandeq.dailyfins.summarymkt.short-ratiojquants schema eq.daily-f| What you want to do | Command |
|---|---|
| Log in (first time setup) | |
| Log out | |
| Check API field list | |
| Field details for specific endpoint | |
| What you want to do | Command | Update Time |
|---|---|---|
| All ticker master | | Around 17:30 daily |
| Stock price OHLCV | | Around 16:30 daily |
| Morning session OHLCV | | Around 12:00 daily |
| Minute bar data | | Around 16:30 daily |
| Trading status by investor sector | | Weekly (Thursday) around 18:00 |
| Earnings announcement scheduled date | | Irregular around 19:00 |
| Stock price tick data | | Around 16:30 daily |
| What you want to do | Command | Update Time |
|---|---|---|
| Trading breakdown | | Around 18:00 daily |
| Daily published margin balance | | Around 16:30 daily |
| Weekend margin balance | | Weekly (Tuesday) around 16:30 |
| Trading calendar | | Irregular |
| Short selling ratio by industry | | Around 16:30 daily |
| Short selling balance report | | Around 17:30 daily |
| What you want to do | Command | Update Time |
|---|---|---|
| Futures OHLCV | | Around 27:00 daily |
| Options OHLCV | | Around 27:00 daily |
| Nikkei 225 options | | Around 27:00 daily |
| What you want to do | Command | Update Time |
|---|---|---|
| Financial statements | | Around 18:00 daily (flash) / around 24:30 (final) |
| Dividend information | | Around 12:00~19:00 daily |
| Financial information summary | | Around 18:00 daily (flash) / around 24:30 (final) |
| What you want to do | Command | Update Time |
|---|---|---|
| TOPIX index OHLCV | | Around 16:30 daily |
| Index OHLCV | | Around 16:30 daily |
| Category | Reference | Scenarios to refer |
|---|---|---|
| eq | references/commands-eq.md | Ticker code/date/period filters, special behavior of |
| mkt | references/commands-mkt.md | Special flags such as |
| deriv | references/commands-deriv.md | Usage of |
| fins | references/commands-fins.md | FS field of |
| idx | references/commands-idx.md | Index code specification, TOPIX |
| bulk | references/commands-bulk.md | Judgment criteria, workflow, endpoint list for bulk download |
| plans | references/plans.md | API availability, obtainable period, add-on information by plan |
| schedule | references/data-update-schedule.md | When you need data freshness judgment, detailed update timing, scenario-based judgment examples |
# 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 # --save is required for Parquet
# 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
# 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
# Process data with pipes
jquants eq daily --code 86970 | head -5 # Automatic CSV
jquants --output json eq daily --code 86970 | jq '.[0]' # Explicit JSON# 1. Confirm ticker code
jquants eq master --code 72030
# 2. Confirm field names
jquants schema eq.daily
# 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# Do not loop with individual APIs. Use bulk for all tickers.
jquants bulk get --endpoint /equities/bars/daily --date 2026-03 --download
# Decompress and use as CSV
gunzip *.gz# Dividend information (period specified)
jquants --output csv --save div.csv fins dividend --from 2026-01-01 --to 2026-03-31
# Financial summary (ticker specified, JSON recommended)
jquants --output json fins summary --code 86970
# Complete financial statement data (JSON required for FS field)
jquants --output json fins details --code 86970eqeq trades/equities/trades--code--date YYYY-MMYYYY-MM-DD--downloadjquants eq trades --date 2025-12 # Get URL only
jquants eq trades --date 2025-12 --download # Download filefins details"N items"--output json--contract-flag 1deriv futuresderiv options| Plan | Limit |
|---|---|
| Free | 5 |
| Light | 60 |
| Standard | 120 |
| Premium | 500 |
| Add-on | Limit |
|---|---|
| Stock minute bar/tick data | 60 |
429 Too Many Requestsbulk get| Minimum required plan | CLI command |
|---|---|
| Free | |
| Light | |
| Standard | |
| Premium | |
| Add-on | |
Plan hierarchy: Free < Light < Standard < Premium (higher plans include all APIs of lower plans)
Free plan restrictions: CSV/bulk download is not supported (except). 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).mkt calendar
| Estimated update time | Reflected data |
|---|---|
| ~12:00 | Morning session OHLCV ( |
| ~16:30 | Stock price OHLCV, minute bars, tick data, indices, short selling ratios, daily margin balances updated for the current day |
| ~17:30 | Ticker master, short selling balance report updated |
| ~18:00 | Trading breakdown, investor sector data (weekly), financial information (flash) updated |
| ~19:00 | Earnings announcement scheduled date updated (irregular, linked to JPX) |
| ~24:30 | Financial information (final), financial statements (final) updated |
| ~27:00 | Derivatives (futures, options) updated for the current day (27:00 = 3:00 AM next day) |
| Mistake | Correct writing | Reason |
|---|---|---|
| | clap parses flags after the subcommand as options of the subcommand itself |
| | Table format does not support |
| | short-ratio API is designed to filter by 33 industry classification, not by ticker |
| Use | Announcement date and calculation date are separate concepts. |
| | Month specification is only supported for bulk APIs. Individual APIs use daily units |
Repeatedly run | | Avoid API rate limit & improve efficiency. All tickers can be obtained in one file |
| | Parquet does not support streaming output, so file saving is required |
| | API field names are PascalCase and case-sensitive |
FS becomes | Use | FS field is a nested JSON object, which is summarized in table view |
| Retry immediately after receiving 429 | Wait for tens of seconds to minutes before retrying | Continuous excessive exceeding will result in about 5 minutes of blocking. Immediate retry prolongs the blocking period |
Use | Use individual APIs ( | Free plan does not support CSV/bulk download (except |
Use | Inform the user that Standard plan is required | These 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 | 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 | 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 Tuesday | Weekend margin balance is weekly data updated around 16:30 on the 2nd business day (usually Tuesday) |