آمار کالکشن NFT
GET
/api/v1/nfts/collections/{slug}/statsscope: products:readاحراز هویت: Bearerlive و test
حجم معاملات ۲۴ ساعت/۷ روز/۳۰ روز، تعداد فروش، میانگین، بالاترین و پایینترین فروش، تغییر قیمت ۲۴ ساعته و ۷ روزه و کف قیمت در Stard.
درخواست
| نام | محل | نوع | توضیح | |
|---|---|---|---|---|
Authorization | header | string | الزامی | Bearer sk_live_… یا Bearer sk_test_… |
slug | path | string | الزامی | slug کالکشن، مثل plushpepe |
نمونه
curl "https://stard-market.ir/api/v1/nfts/collections/plushpepe/stats" \
-H "Authorization: Bearer $STARD_API_KEY"const res = await fetch("https://stard-market.ir/api/v1/nfts/collections/plushpepe/stats", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.STARD_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);type StardError = { error: { type: string; code: string; message: string; param: string | null; request_id: string } };
const res = await fetch("https://stard-market.ir/api/v1/nfts/collections/plushpepe/stats", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.STARD_API_KEY}`,
},
});
if (!res.ok) {
const { error } = (await res.json()) as StardError;
throw new Error(`${error.code}: ${error.message} (${error.request_id})`);
}
const data: Record<string, unknown> = await res.json();import os
import requests
r = requests.get(
"https://stard-market.ir/api/v1/nfts/collections/plushpepe/stats",
headers={
"Authorization": f"Bearer {os.environ['STARD_API_KEY']}",
},
timeout=20,
)
data = r.json()
if r.status_code >= 400:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)<?php
$ch = curl_init("https://stard-market.ir/api/v1/nfts/collections/plushpepe/stats");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("STARD_API_KEY"),
],
CURLOPT_TIMEOUT => 20,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data["error"]["code"] . ": " . $data["error"]["message"]);
}
print_r($data);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://stard-market.ir/api/v1/nfts/collections/plushpepe/stats", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("STARD_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(b))
}پاسخ — 200
{
"collection": "finepen",
"volume_24h_ton": 27.99,
"volume_7d_ton": 27.99,
"volume_30d_ton": 85.84,
"sales_24h": 3,
"sales_7d": 3,
"sales_30d": 10,
"average_price_7d_ton": 9.33,
"highest_sale_30d_ton": 10.0,
"lowest_sale_30d_ton": 2.0,
"price_change_24h_percent": null,
"price_change_7d_percent": 20.39,
"active_listings_on_stard": 15,
"floor_price_on_stard": {
"amount": 4023613,
"currency": "IRT"
},
"ton_rate_irt": 399168,
"object": "collection_stats"
}هدرهای پاسخ
content-type: application/json
x-request-id: req_qVYBIZExg4YE4R4Wh31s
x-ratelimit-limit: 1000
x-ratelimit-remaining: 983خطاها
| HTTP | code | کی |
|---|---|---|
400 | parameter_invalid | slug نامعتبر |
403 | insufficient_scope | کلید scope products:read را ندارد |
401 | invalid_api_key / missing_api_key / api_key_revoked / api_key_expired | کلید نیامده، نامعتبر، باطل یا منقضی است |
429 | rate_limit_exceeded | سقف درخواست در دقیقه پر شده؛ بعد از Retry-After ثانیه دوباره بفرست |
محدودیت نرخ
پیشفرض ۶۰ درخواست در دقیقه برای هر کلید (قابل تنظیم در داشبورد). وضعیت در هدرهای X-RateLimit-* برمیگردد — جزئیات.
