Convert Figma logo to code with AI

FinMind logoFinMind

Open Data, more than 50 financial data. 提供超過 50 個金融資料(台股為主),每天更新 https://finmind.github.io/

2,173
347
2,173
46

Top Related Projects

A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)

A curated list of practical financial machine learning tools and applications.

18,978

Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL.

16,815

Download market data from Yahoo! Finance's API

Quick Overview

FinMind is an open-source Python library that provides access to various financial data sources, including stock prices, fundamental data, and economic indicators. It aims to simplify the process of obtaining and analyzing financial data for researchers, traders, and data scientists.

Pros

  • Comprehensive data coverage across multiple markets and asset classes
  • Easy-to-use API with consistent data formats
  • Regular updates and maintenance by an active community
  • Supports both historical and real-time data retrieval

Cons

  • May require API keys for certain data sources
  • Documentation could be more extensive for advanced use cases
  • Limited support for non-Python users
  • Some data sources may have usage limitations or restrictions

Code Examples

Fetching stock price data:

from FinMind.data import DataLoader

api = DataLoader()
df = api.taiwan_stock_daily(
    stock_id="2330",
    start_date="2023-01-01",
    end_date="2023-04-30"
)
print(df.head())

Retrieving fundamental data:

from FinMind.data import DataLoader

api = DataLoader()
df = api.fundamental_fundamental_features(
    stock_id="2330",
    start_date="2023-01-01",
    end_date="2023-04-30"
)
print(df.head())

Accessing economic indicators:

from FinMind.data import DataLoader

api = DataLoader()
df = api.taiwan_economic_indicator(
    indicator="GDP",
    start_date="2023-01-01",
    end_date="2023-04-30"
)
print(df.head())

Getting Started

To get started with FinMind, follow these steps:

  1. Install the library:

    pip install FinMind
    
  2. Import the DataLoader and create an instance:

    from FinMind.data import DataLoader
    api = DataLoader()
    
  3. Use the API to fetch data:

    df = api.taiwan_stock_daily(
        stock_id="2330",
        start_date="2023-01-01",
        end_date="2023-04-30"
    )
    print(df.head())
    

For more detailed information and advanced usage, refer to the official documentation on the FinMind GitHub repository.

Competitor Comparisons

A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)

Pros of awesome-quant

  • Comprehensive curated list of resources for quantitative finance
  • Covers a wide range of topics including data sources, libraries, and tools
  • Community-driven with contributions from various experts in the field

Cons of awesome-quant

  • Not a standalone library or tool, primarily a collection of links
  • Requires users to explore and evaluate individual resources
  • May include outdated or deprecated tools without regular maintenance

Code comparison

FinMind provides a Python library for data retrieval:

from FinMind.data import DataLoader

dl = DataLoader()
data = dl.taiwan_stock_daily(
    stock_id="2330",
    start_date="2020-01-01",
    end_date="2020-01-10"
)

awesome-quant doesn't provide direct code examples but lists libraries like:

import pandas_datareader as pdr
import yfinance as yf
import quandl

Summary

FinMind is a dedicated financial data API and analysis tool, while awesome-quant serves as a comprehensive resource list for quantitative finance. FinMind offers a more focused approach with its own data retrieval system, whereas awesome-quant provides a broader overview of available tools and resources in the field. The choice between them depends on whether you need a specific data solution (FinMind) or a starting point for exploring various quantitative finance resources (awesome-quant).

A curated list of practical financial machine learning tools and applications.

Pros of financial-machine-learning

  • More comprehensive coverage of machine learning techniques in finance
  • Includes advanced topics like reinforcement learning and natural language processing
  • Provides more in-depth explanations and theoretical background

Cons of financial-machine-learning

  • Less focus on data acquisition and preprocessing
  • May be more challenging for beginners to understand and implement
  • Fewer ready-to-use tools and functions compared to FinMind

Code Comparison

FinMind example:

from FinMind.data import DataLoader

dl = DataLoader()
data = dl.taiwan_stock_daily(
    stock_id="2330",
    start_date="2020-01-01",
    end_date="2020-12-31"
)

financial-machine-learning example:

import pandas as pd
from sklearn.ensemble import RandomForestRegressor

X = pd.read_csv('features.csv')
y = pd.read_csv('target.csv')
model = RandomForestRegressor()
model.fit(X, y)

The FinMind example focuses on data retrieval, while the financial-machine-learning example demonstrates model implementation. FinMind provides easier access to financial data, whereas financial-machine-learning emphasizes advanced modeling techniques.

18,978

Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL.

Pros of qlib

  • More comprehensive and advanced quantitative investment platform
  • Stronger focus on AI-driven strategies and model training
  • Larger community and more frequent updates

Cons of qlib

  • Steeper learning curve for beginners
  • More complex setup and configuration
  • Primarily focused on Chinese stock market data

Code Comparison

FinMind example:

from FinMind.data import DataLoader

dl = DataLoader()
df = dl.taiwan_stock_daily(
    stock_id="2330",
    start_date="2020-01-01",
    end_date="2020-12-31"
)

qlib example:

import qlib
from qlib.data import D

qlib.init()
df = D.features(
    ["sh000300"],
    ["$close", "$volume"],
    start_time="2020-01-01",
    end_time="2020-12-31"
)

Both libraries provide easy access to financial data, but qlib offers more advanced features for quantitative analysis and model development. FinMind is more straightforward for basic data retrieval, especially for Taiwanese markets, while qlib is better suited for complex quantitative research and strategy development, with a focus on the Chinese market.

16,815

Download market data from Yahoo! Finance's API

Pros of yfinance

  • Lightweight and easy to use, focusing specifically on Yahoo Finance data
  • Supports real-time and historical data retrieval
  • Actively maintained with frequent updates

Cons of yfinance

  • Limited to Yahoo Finance as a data source
  • May experience occasional issues due to changes in Yahoo Finance's API
  • Less comprehensive in terms of data types and analysis tools

Code Comparison

FinMind example:

from FinMind.data import DataLoader

dl = DataLoader()
df = dl.taiwan_stock_daily(
    stock_id="2330",
    start_date="2020-01-01",
    end_date="2020-12-31"
)

yfinance example:

import yfinance as yf

ticker = yf.Ticker("AAPL")
df = ticker.history(start="2020-01-01", end="2020-12-31")

Both libraries offer straightforward ways to fetch stock data, but FinMind provides more specific functions for different markets and data types, while yfinance focuses on a simpler, more general approach using Yahoo Finance data.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Build Status license Documentation Status Gitter PyPI version

Donate

Quickstart

pip install FinMind

這是什麼?

FinMind 是超過 50 種金融開源數據 50 datasets。 包含

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

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

What is this?

FinMind is open source of more than 50 datasets, 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

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

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

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

Note

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