Crates.io | twstock |
lib.rs | twstock |
version | 0.1.1 |
source | src |
created_at | 2024-07-25 03:43:07.209174 |
updated_at | 2024-07-25 03:56:45.590077 |
description | API binding for fetching data from the Taiwan Stock Exchange (TWSE) |
homepage | |
repository | https://github.com/Eason0729/twstock-rs |
max_upload_size | |
id | 1314639 |
size | 31,700 |
API binding for fetching data from the Taiwan Stock Exchange (TWSE)
use twstock::*;
#[tokio::main]
async fn main() {
let client = Client::new();
match client
.realtime()
.fetch(Stock {
kind: StockKind::Live,
code: 2330,
})
.await
{
Ok(x) => assert_eq!(x.name, "台積電"),
Err(err) => match err {
Error::MarketClosed => {}
_ => panic!("unexpected error: {:?}", err),
},
};
}
twstock(pypi): 給予API使用參考 使用證卷交易所API爬取股票資訊(hackmd文章)