You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python对接CoinEx API V2时遭遇「Access ID does not exist」错误的排查求助

Python对接CoinEx API V2时遭遇「Access ID does not exist」错误的排查求助

我之前找了不少CoinEx API对接的相关资料,但发现它们全都是基于v1版本的API实现的,而我想对接的是v2版本的API。于是我参照CoinEx的v2 API授权文档,写了下面这段Python 3代码,用来获取账户的基础信息:

import time
import requests
import hmac
import hashlib
baseUrl = 'https://api.coinex.com'
requestPath = '/v2/account/info'
timestamp = int(time.time()*1000)
preparedString = "GET"+requestPath+str(timestamp)
accessId = '???'
secretKey = '???'
signed_str = hmac.new(bytes(secretKey, 'latin-1'), bytes(preparedString, 'latin-1'), hashlib.sha256).hexdigest().lower()
params = {'X-COINEX-KEY':accessId,
         'X-COINEX-SIGN':signed_str,
         'X-COINEX-TIMESTAMP':timestamp}
response = requests.get(baseUrl+requestPath,
                        params=params
                        )
response.json()

但运行这段代码后,我得到了这样的错误返回:

{'code': 11003, 'data': {}, 'message': 'Access ID does not exist'}

更困惑的是,这个11003错误码在CoinEx官方的v2 API错误处理文档里根本找不到对应的说明。

我可以百分百确定我的access_id和secret_key是正确的——因为用同样的凭证,我能正常调用公开接口(比如/futures/ticker?market=BTCUSDT)获取市场数据,完全没有问题。

有没有大佬能帮我分析下,为什么调用私有接口时会抛出「Access ID does not exist」这个错误呢?

备注:内容来源于stack exchange,提问作者Sadabadi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 17:25:29