使用示例

初始化客户端:

from asharehub import AShareHub
client = AShareHub(api_key="ash_your_key_here")

获取日线行情:

df = client.market_daily(symbol="000001.SZ", start_date="20240101", end_date="20240331")
print(df.head())

获取北向资金:

flows = client.moneyflow_hsgt(start_date="20240101", end_date="20240131")
print(flows[["trade_date", "north_money"]].head())

获取财务指标:

fina = client.financial_indicators(symbol="000001.SZ")
print(fina[["end_date", "roe", "grossprofit_margin", "eps"]].head())

全部方法一览:

方法接口说明
market_daily()/v2/market/daily日线行情
fundamentals()/v2/market/fundamentalsPE/PB/换手率/市值
adj_factor()/v2/market/adj-factor复权因子
technical_factors()/v2/market/technical-factorsMACD/KDJ/RSI/BOLL/CCI
technical_factors_pro()/v2/market/technical-factors-pro200+ 技术指标
margin()/v2/market/margin融资融券明细
block_trade()/v2/market/block-trade大宗交易
top_list()/v2/market/top-list龙虎榜
top_inst()/v2/market/top-inst龙虎榜机构席位
shareholders()/v2/market/shareholders股东人数
holder_trade()/v2/market/holder-trade股东增减持
concepts()/v2/market/concepts概念板块指数
concept_members()/v2/market/concept-members概念成分股
limit_list()/v2/market/limit-list涨跌停统计
moneyflow_hsgt()/v2/flows/moneyflow-hsgt沪深港通资金
moneyflow()/v2/flows/moneyflow个股资金流向
northbound_holdings()/v2/flows/northbound-holdings北向持股明细
southbound_holdings()/v2/flows/southbound-holdings南向持股明细
chip_distribution()/v2/chips/distribution筹码分布
fx_daily()/v2/fx/daily外汇行情
index_daily()/v2/indices/daily指数日线
index_weight()/v2/indices/index-weight指数权重
financial_indicators()/v2/financials/indicators50+ 财务指标
income()/v2/financials/income利润表
balance_sheet()/v2/financials/balance-sheet资产负债表
cash_flow()/v2/financials/cash-flow现金流量表
forecast()/v2/financials/forecast业绩预告
express()/v2/financials/express业绩快报
audit()/v2/financials/audit审计意见
main_business()/v2/financials/main-business主营业务构成
disclosure_date()/v2/financials/disclosure-date财报披露日期
analyst_reports()/v2/financials/analyst-reports研报分析
dividend()/v2/shareholders/dividend分红送股
stock_list()/v2/reference/stocks股票列表
industry_list()/v2/reference/industries申万行业分类
trade_calendar()/v2/reference/trade-calendar交易日历