iT邦幫忙

2021 iThome 鐵人賽

DAY 8
0
永豐金融APIs

視覺化跨平台Client與永豐金融證券APIs系列 第 8

Scanners API-總金額篇

這個API可以取得總金額的排名,
步驟如下:

(1)匯入需要的庫

import shioaji as sj

(2)登入永豐證券帳密

api = sj.Shioaji(simulation=True)
api.login(
    person_id='PAPIUSER01',
    passwd='2222',
    contracts_cb=lambda security_type: print(f"{repr(security_type)} fetch done.")
)

(3)使用Scanners API,
scanner_type是型態這邊使用的是總金額型態、count是你要查看的排名數

scanner = api.scanners(
            scanner_type = sj.constant.ScannerType.AmountRank, 
            count = 5
          )

(4)打印結果如下(當然也可以用pandas整理)

print(scanner)

https://ithelp.ithome.com.tw/upload/images/20210923/20107848XGitJiBDDQ.jpg

內容有Scanner的時間、股票名稱、總金額、昨量等等數字可以做參考。


上一篇
kbars API測試
下一篇
Scanners API-價格篇 && Pandas設定
系列文
視覺化跨平台Client與永豐金融證券APIs30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言