Skip to main content

Build Status license Documentation Status Gitter PyPI version Python Versions

Donate

Quickstart

pip install FinMind

LLM / AI 整合

想用 ChatGPT、Claude 等 AI 工具查詢 FinMind 的資料集和 API 用法?我們提供 llms.txt,讓 AI 快速理解 FinMind 的所有資料集、API 端點與使用方式。

只要將以下連結貼給你的 AI 助手,即可開始對話:

  • llms.txt — 精簡版,資料集索引與 API 概覽
  • llms-full.txt — 完整版,包含所有資料集的欄位名稱、SDK 方法、參數範例
  • Agent Skill 教學 — 讓 AI Agent(如 Claude Code)直接查詢 FinMind 資料

這是什麼?

FinMind 提供台灣與國際市場的金融開源數據,完整資料集清單請見官方文件。 包含

  • 技術面 : 台股股價 daily、即時報價、歷史 tick、PER、PBR、每5秒委託成交統計、加權指數、當日沖銷交易標的及成交量值。
  • 基本面 : 綜合損益表、現金流量表、資產負債表、股利政策表、除權除息結果表、月營收。
  • 籌碼面 : 外資持股、股權分散表、融資融券、三大法人買賣、借券成交明細。
  • 消息面 : 台股相關新聞。
  • 衍生性商品 : 期貨、選擇權 daily data、即時報價、交易明細,選擇權、期貨三大法人買賣,期貨各卷商每日交易、選擇權各卷商每日交易。
  • 國際市場 : 美股股價 daily、minute、美國債券殖利率、貨幣發行量(美國)、黃金價格、原油價格、G8 央行利率、G8 匯率、

資料每天更新。你不需收集資料,就可進行分析。

What is this?

FinMind provides open financial datasets for Taiwan and international markets. See the official documentation for the current dataset list, including

Taiwan stock trade data daily, Taiwan stock trade data (5 seconds) (2019-05-29 ~ now, more than 30 million data in total), Financial Statements, Balance Sheet, Cash Flows Statement, Month Revenue, Holding Shares Per, Institutional Investors Buy Sell. Taiwan Futures Trade Detail, Taiwan Option Trade Detail.

US stock price daily, minute (2019-06-01 ~ now, more than 80 million data in total), oil price, gold price, G7 exchange rate, interest rate.

US Government Bonds Yield.

The datasets are automatically updated daily. You can analyze financial data without having to collect the data by yourself.


License

  • License Detail

  • 本專案提供的所有內容均用於教育、非商業用途。資料僅供參考,使用者依本資料交易發生交易損失需自行負責,本專案不對資料內容錯誤、更新延誤或傳輸中斷負任何責任。

資訊來源與使用規定 / Data Source & Usage Rules

資訊來源:臺灣證券交易所「TWSE」|本資訊由芬麥數據股份有限公司處理提供

  1. 使用者須遵守臺灣證券交易所『交易資訊使用管理辦法』等交易資訊管理相關規定。
  2. 所有資訊以臺灣證券交易所公告資料為準。
  • 台股即時資料:依臺灣證券交易所規定,使用台股即時資料(taiwan_stock_tick_snapshot)須於 2027-01-31 前在會員中心填寫姓名、電話、地址。2027-01-31 前未填寫仍可使用,API 回應會附 profile_notice 提醒;2027-01-31 起未填寫者將無法取得台股即時資料(HTTP 403)。資料用途請見隱私權政策。
  • 券商分點類資料(台股分點、權證分點、當日卷商分點統計、鉅額交易買賣日報表):任何方案(包含 Sponsor Pro)皆僅限用戶自行使用,不得以任何形式再傳輸或提供予第三人。
  • 詳見免責聲明與資料授權。

Source: Taiwan Stock Exchange (TWSE) | This information is processed and provided by 芬麥數據股份有限公司 (FinMind)

  1. Users must comply with the TWSE Regulations Governing the Use of Trading Information and other applicable rules on trading information.
  2. All information is subject to the data announced by the Taiwan Stock Exchange.
  • Taiwan stock real-time data: under Taiwan Stock Exchange regulations, users of Taiwan stock real-time data (taiwan_stock_tick_snapshot) must fill in their name, phone number, and address in the Member Center by 2027-01-31. Before then, users who have not filled it in can still use the data, with a profile_notice reminder in API responses; from 2027-01-31 they will no longer be able to get Taiwan stock real-time data (HTTP 403). See the Privacy Policy.
  • Broker branch data (stock and warrant broker branch trading reports, daily branch aggregate statistics, block trading daily report): for your own use only under every plan, including Sponsor Pro; must not be retransmitted or provided to third parties in any form.
  • See Disclaimer & Data Licensing.

Project of Contents

Plotting

kbar_plotting.ipynb

# 取得股價
from FinMind.data import DataLoader

dl = DataLoader()
# 下載台股股價資料
stock_data = dl.taiwan_stock_daily(
    stock_id='2609', start_date='2018-01-01', end_date='2021-06-26'
)
# 下載三大法人資料
stock_data = dl.feature.add_kline_institutional_investors(
    stock_data
) 
# 下載融資券資料
stock_data = dl.feature.add_kline_margin_purchase_short_sale(
    stock_data
)

# 繪製k線圖
from FinMind import plotting

plotting.kline(stock_data)

gif

dashboard

png

Contact

Email: FinMind.TW@gmail.com

每週日早上零點至早上七點為維護時間,不提供服務。

Contributing

See CONTRIBUTING.md for the development setup, test commands, and pull request checklist.

Note

  • 未來預計新增更多功能,包含個人化回測分析、chatbot 監控策略,
  • API Request 上限:300 / 小時。
  • Limit amount of request, 300 / hour.
  • 至FinMind官網註冊並驗證信箱後,API 的 Request 加上 token 參數可以提高使用上限到 600/hr。
  • token 獲取方法,可在官網登入後獲取。

Metadata

Release files for finmind 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for finmind 2.1.1
File Size Uploaded Provenance Actions
finmind-2.1.1.tar.gz 71.1 kB Without provenance Details for finmind-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for finmind 2.1.1
File Interpreter ABI Platform Actions
finmind-2.1.1-py3-none-any.whl Python 3 none any Details for finmind-2.1.1-py3-none-any.whl

Total release size: 156.4 kB

Release files / finmind-2.1.1.tar.gz

Download URL finmind-2.1.1.tar.gz
Size 71.1 kB
Tags Source
SHA-256 checksum
How to use checksums
365100af3a56e00f4221ef485ddb1dcc58df94c7ac14dbb7c79b5f3c7c5ec41f
BLAKE2b-256 checksum
How to use checksums
f7ce7ea3f703cd037f3e9b6ca2b36a8a0054910bff0eed0310b5691c007c6ae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / finmind-2.1.1-py3-none-any.whl

Download URL finmind-2.1.1-py3-none-any.whl
Size 85.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acc77946cab8af0705cce8ce266db90adc4654b1f9551097b816ad06e9b939c9
BLAKE2b-256 checksum
How to use checksums
575e2e7e89e806cda4a8d31ea577ea1f0ebec4e92ba6191d2b6cc6d8087ece90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for finmind 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page