认证方式
IPKingStar API 使用 API Key 进行认证。每个请求都需要在 HTTP Header 中包含您的 API Key。
API Key 认证
在每个 API 请求的 Header 中添加CODE和TOKEN字段:
--header 'x-merchant-token: CODE'
--header 'x-merchant-code: TOKEN'
示例:
fetch('/api/ipks/simple/check', {
headers: {
'x-merchant-token': 'YOU TOKEN',
'x-merchant-code': 'YOU CODE'
}
})
示例输出:
{"msg":"验证成功,欢迎使用IPKingStar api,","code":200}
获取 API Key
- 登录您的 IPKingStar 账户
- 进入控制面板的 API 设置页面
- 生成新的 API Key

安全建议
- 请妥善保管您的 API Key,不要泄露给他人
- 定期更换 API Key 以提高安全性
- 不要在客户端代码中硬编码 API Key
- 如果怀疑 API Key 泄露,请立即重新生成