AlphaKit — 简洁的金融数据 API 工具包
Project description
AlphaKit SDK
简洁的 A 股市场数据 API 工具包。仅供个人学习使用。
安装
pip install alphakit-sdk
快速开始
import alphakit as ak
ak.set_token('your_token_here')
api = ak.AlphaKit()
# 默认获取最近一年日线
df = api.daily(ts_code='000001.SZ')
print(df)
客户端初始化
import alphakit as ak
# 全局 token
ak.set_token('your_token_here')
api = ak.AlphaKit()
# 实例化时传入
api = ak.AlphaKit(token='your_token_here')
API 接口
股票
# 股票列表
api.stock_basic()
api.stock_basic(ts_code='000001.SZ')
同花顺板块(v0.2.6 新增)
api.ths_index() # 板块清单(~1700)
api.ths_daily(trade_date='20260618') # 板块日线
api.ths_member(ts_code='883300.TI') # 板块成分
更多接口见仓库文档。
错误码
| 错误码 | 含义 | 处理 |
|---|---|---|
| 1001 | Token 无效/过期 | 检查 token |
| 1002 | 等级无权访问 | 升级等级 |
| 1003 | IP 限制 | 检查 IP 绑定 |
| 1004 | 触发限频 | 降低请求频率 |
| 1005 | 当日配额用尽 | 等次日或提升配额 |
| 1006 | 参数错误 | 检查参数 |
| 1500 | 服务器错误 | 稍后重试 |
| 9999 | 网络失败 | 检查网络 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
alphakit_sdk-0.2.7.tar.gz
(11.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alphakit_sdk-0.2.7.tar.gz.
File metadata
- Download URL: alphakit_sdk-0.2.7.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
990e25df56fffe2565a36f4d78b0b0b69a7c31256af0743db4cb585986dbc440
|
|
| MD5 |
37cfd46dca69276e9c79ba3d43fc7d2d
|
|
| BLAKE2b-256 |
23440bf643293dbc7e9c822d84d4912e6aaa32cfb64c9cd91987cd455a30f2a4
|
File details
Details for the file alphakit_sdk-0.2.7-py3-none-any.whl.
File metadata
- Download URL: alphakit_sdk-0.2.7-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8495a8736e15689c725edf0b85e34ab28e8a73ebc1d7ff716230aec04bf7077b
|
|
| MD5 |
e27cecbc301a1462a88d074dd91e460d
|
|
| BLAKE2b-256 |
ee2d069f96e2039788d513228b0eb872051bf15214fb30fbbfbd945487c14a02
|