按 slug 获取 VRF 卡包
curl --request GET \
--url https://api.renaiss.xyz/v2/gacha/packs/{slug}const options = {method: 'GET'};
fetch('https://api.renaiss.xyz/v2/gacha/packs/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/gacha/packs/{slug}"
response = requests.get(url)
print(response.text){
"cardPack": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"packType": "limited",
"stage": "countdown",
"description": "<string>",
"priceInUsdt": "<string>",
"expectedValueInUsd": "<string>",
"packBannerVideoUrl": "<string>",
"gachaMachineVideoUrl": "<string>",
"gachaRippingPackAnimationVideoUrl": "<string>",
"onChainPackId": "<string>",
"vendingMachineAddress": "<string>",
"tiers": [
{
"tier": 123,
"name": "TOP",
"chance": 123,
"priceRangeInUsd": {
"min": "<string>",
"max": "<string>"
}
}
],
"activeSetExpectedValueInUsd": "<string>",
"buybackConfig": [
{
"buybackPercentage": 123,
"buybackExpiredInSeconds": 1
}
]
}
}{
"code": "WRONG_REQUEST_PARAMS",
"message": "<string>"
}{
"error": "Invalid authentication credential",
"code": "API_AUTH_INVALID_CREDENTIAL"
}{
"error": "Credential is not allowed by this policy",
"code": "API_AUTH_CREDENTIAL_NOT_ALLOWED"
}{
"code": "CARD_PACK_NOT_FOUND",
"message": "<string>"
}{
"code": "SUBGRAPH_ABORTED",
"message": "Unable to load pack details"
}{
"code": "SUBGRAPH_RATE_LIMITED",
"message": "<string>"
}{
"code": "FUNCTION_ERROR",
"message": "Unable to load pack details"
}{
"message": "Unable to load pack details",
"code": "SUBGRAPH_NETWORK_ERROR"
}卡包目录
获取卡包详情
使用 slug 查询单个卡包的价格、各档概率和回购规则。
GET
/
v2
/
gacha
/
packs
/
{slug}
按 slug 获取 VRF 卡包
curl --request GET \
--url https://api.renaiss.xyz/v2/gacha/packs/{slug}const options = {method: 'GET'};
fetch('https://api.renaiss.xyz/v2/gacha/packs/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/gacha/packs/{slug}"
response = requests.get(url)
print(response.text){
"cardPack": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"packType": "limited",
"stage": "countdown",
"description": "<string>",
"priceInUsdt": "<string>",
"expectedValueInUsd": "<string>",
"packBannerVideoUrl": "<string>",
"gachaMachineVideoUrl": "<string>",
"gachaRippingPackAnimationVideoUrl": "<string>",
"onChainPackId": "<string>",
"vendingMachineAddress": "<string>",
"tiers": [
{
"tier": 123,
"name": "TOP",
"chance": 123,
"priceRangeInUsd": {
"min": "<string>",
"max": "<string>"
}
}
],
"activeSetExpectedValueInUsd": "<string>",
"buybackConfig": [
{
"buybackPercentage": 123,
"buybackExpiredInSeconds": 1
}
]
}
}{
"code": "WRONG_REQUEST_PARAMS",
"message": "<string>"
}{
"error": "Invalid authentication credential",
"code": "API_AUTH_INVALID_CREDENTIAL"
}{
"error": "Credential is not allowed by this policy",
"code": "API_AUTH_CREDENTIAL_NOT_ALLOWED"
}{
"code": "CARD_PACK_NOT_FOUND",
"message": "<string>"
}{
"code": "SUBGRAPH_ABORTED",
"message": "Unable to load pack details"
}{
"code": "SUBGRAPH_RATE_LIMITED",
"message": "<string>"
}{
"code": "FUNCTION_ERROR",
"message": "Unable to load pack details"
}{
"message": "Unable to load pack details",
"code": "SUBGRAPH_NETWORK_ERROR"
}| 数据 | 含义 |
|---|---|
| 各档概率 | 按整组卡牌计算并四舍五入。 |
expectedValueInUsd | 卡包资料中保存的期望价值。 |
activeSetExpectedValueInUsd | v3 抽卡机当前整组卡牌的平均价值。尚未抽出的卡牌可能有不同的均值。 |
请求
开发者密钥可选
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | INVALID_SCHEMA | message | Unable to load pack details |
400 | WRONG_REQUEST_PARAMS | message | Bad request - invalid parameters |
401 | API_AUTH_INVALID_CREDENTIAL | error | Invalid authentication credential开发者密钥格式错误、未知、已过期或已撤销。请核对并更换密钥。 |
403 | API_AUTH_CREDENTIAL_NOT_ALLOWED | error | Credential is not allowed by this policy省略全部凭据,或仅通过 x-builder-api-key 发送可选的开发者密钥。 |
403 | GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API | error | This builder checks out on its own surface, not on the public API此密钥无法用于当前 API。请联系 Renaiss,无需重试。 |
404 | CARD_PACK_NOT_FOUND | message | Pack not found |
408 | SUBGRAPH_ABORTED | message | Unable to load pack details主网读取卡包超时时可能返回此码。测试网在相同情况下返回 HTTP 502 和 SUBGRAPH_NETWORK_ERROR。 |
429 | API_AUTH_RATE_LIMITED | error | Authentication rate limit exceeded已达到密钥的请求频率上限。稍候再以较低频率重试。 |
429 | SUBGRAPH_RATE_LIMITED | message | Unable to load pack details |
500 | API_AUTH_ERROR | error | Internal server error |
500 | FUNCTION_ERROR | error | Internal server error |
500 | FUNCTION_ERROR | message | Unable to load pack details |
500 | CARD_PACKS_QUERY_FAILEDSUBGRAPH_QUERY_FAILED | message | Unable to load pack details请稍后重新查询。 |
500 | 其他错误码 | message | Unable to load pack details |
502 | SUBGRAPH_NETWORK_ERRORSUBGRAPH_REQUEST_FAILEDSUBGRAPH_QUERY_ERROR | message | Unable to load pack details请稍后重新查询。 |
502 | 其他错误码 | message | Unable to load pack details |