Skip to content

ljn3333/FinMind

 
 

Repository files navigation

Build Status license PyPI version Documentation Status

這是什麼?

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

台股股價 daily、台股5秒交易資料 ( 2019-05-29 ~ now, 共超過 3 千萬筆 )、財報、資產負債表、現金流量表、月營收、外資持股、股權分散表、融資融券、三大法人買賣,台股期貨、選擇權交易明細。

美股股價 daily、minute ( 2019-06-01 ~ now, 共超過 8 千萬筆 ),G7 匯率、利率。
國際原油價格、黃金價格,美債殖利率。

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

What is it?

FinMind is open source of more than 50 datasets , contain

Taiwan stock trade data daily, Taiwan stock trade data (5 seconds) ( 2019-05-29 ~ now, total more than 30 million data ), 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, total more than 80 million data ), 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.

 pip3 install FinMind

Api

  • Python document

    import requests
    url = 'http://finmindapi.servebeer.com/api/data'
    form_data = {'dataset':'TaiwanStockInfo'}
    res = requests.post(url,verify = True,data = form_data)
    
    url = 'http://finmindapi.servebeer.com/api/data'
    form_data = {'dataset':'TaiwanStockPrice','stock_id':'2317','date':'2019-06-01'}
    res = requests.post(url,verify = True,data = form_data)
    
  • R document

    library(httr) 
    library(jsonlite)
    library('data.table')
    library(dplyr)
    
    url = 'http://finmindapi.servebeer.com/api/data'
    
    # TaiwanStockInfo
    payload<-list( 'dataset' = 'TaiwanStockInfo')
    
    response = POST(url,body = payload,encode="json")
    data = response %>% content 
    data = do.call('cbind',data$data) %>%data.table
    head(data)	
    

translation 中英對照

	import requests
	url = 'http://finmindapi.servebeer.com/api/translation'
	dataset = 'RawMaterialFuturesPrices'
	# or 
	# dataset = 'FinancialStatements'
	# dataset = 'BalanceSheet'
	# dataset = 'StockDividend'
	# dataset = 'TaiwanStockMarginPurchaseShortSale'
	# dataset = 'InstitutionalInvestorsBuySell'
	parameter = {'dataset':dataset}

	res = requests.post(url,verify = True,data = parameter)
	#res.text
	data = res.json()
	data = pd.DataFrame( data['data'] )

Crawler

由於原物料、債券期貨資料,有法規問題,禁止散布,因此我公開爬蟲 code,並簡化不到 5 行 code,各位自行爬蟲,就不是從我這獲得資料,不會有散布問題。
demo.py

Data

  • FinMind.Data

  • 50 data sets

  • Variable Document

    from FinMind.Data import Load
    TaiwanStockInfo = Load.FinData(dataset = 'TaiwanStockInfo')
    	data = Load.FinData(dataset = 'TaiwanStockPrice',select = '2317',
    				date = '2018-10-10')
    

Mind

Document

HistoryUpdate

Financial Visualize ( In development )

At least five kinds of visualization tools for every data type. ( In development )

https://finmind.servebeer.com/ 開發中

Solicit partners who are interested in joint development.
徵求有興趣共同開發的夥伴。
email : linsam.tw.github@gmail.com

About

Open Data, more than 40 financial data. 提供超過 40 個金融資料,每天更新

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%