Skip to main content

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


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.6.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alphakit_sdk-0.2.6-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file alphakit_sdk-0.2.6.tar.gz.

File metadata

  • Download URL: alphakit_sdk-0.2.6.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for alphakit_sdk-0.2.6.tar.gz
Algorithm Hash digest
SHA256 a3ecec283dfeea6425bb137c3ded79fab6004d63b09b99041bfdc6dc8c340d83
MD5 06d8cbf1597f04a27dd439b355882938
BLAKE2b-256 34e3d5cec2ca3eb3583ecbb997c587ad556e2fc9fb4f5e9b6e52435950a58981

See more details on using hashes here.

File details

Details for the file alphakit_sdk-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: alphakit_sdk-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for alphakit_sdk-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d0e07836115e67cb362032884ea4bd2e30a8cdf0946d94741c486106585e03ad
MD5 2cf9cba6e1f544729368d2a3fdb87146
BLAKE2b-256 2aebcd0f6b28b27d856c864938ce8c285079497805d17d402f94a77f5dfe6209

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page