فهرست محصولات
GET
/api/v1/productsscope: products:readاحراز هویت: Bearerlive و test
جستجو و فیلتر روی همهی محصولات قابل نمایش فروشگاه (همان قانونی که مینیاپ استفاده میکند). قیمت هر محصول همان مبلغی است که هنگام خرید کسر میشود.
درخواست
| نام | محل | نوع | توضیح | |
|---|---|---|---|---|
Authorization | header | string | الزامی | Bearer sk_live_… یا Bearer sk_test_… |
category | query | string | اختیاری | یکی از gift، nft، username، number، premium، stars، star_gift، other (جمعها مثل usernames هم پذیرفته میشوند) |
search | query | string | اختیاری | جستجو در نام، توضیح یا تگ (حداکثر ۶۴ کاراکتر) |
pricing_type | query | string | اختیاری | fixed، auction یا negotiable |
min_price | query | integer | اختیاری | حداقل قیمت (تومان) |
max_price | query | integer | اختیاری | حداکثر قیمت (تومان) |
purchasable | query | boolean | اختیاری | فقط محصولاتی که از API قابل خریدند (قیمت ثابت، فروش مستقیم Stard) |
sort | query | string | اختیاری | price_asc (پیشفرض)، price_desc، newest، oldest |
limit | query | integer | اختیاری | تعداد نتیجه در هر صفحه، ۱ تا ۱۰۰ (پیشفرض ۲۰) |
offset | query | integer | اختیاری | چند ردیف رد شود (پیشفرض ۰)؛ برای صفحهی بعد از next_offset استفاده کن |
نمونه
curl "https://stard-market.ir/api/v1/products?category=usernames&limit=2" \
-H "Authorization: Bearer $STARD_API_KEY"const res = await fetch("https://stard-market.ir/api/v1/products?category=usernames&limit=2", {
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/products?category=usernames&limit=2", {
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/products?category=usernames&limit=2",
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/products?category=usernames&limit=2");
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/products?category=usernames&limit=2", 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
{
"object": "list",
"data": [
{
"object": "product",
"id": 22982,
"tag": "UNERZA",
"name": "@stard_sample",
"description": "یوزرنیم نمونه",
"category": "username",
"pricing_type": "fixed",
"price": {
"amount": 400000,
"currency": "IRT"
},
"starting_price": null,
"auction_end_at": null,
"stars_price": null,
"available": true,
"purchasable_via_api": false,
"not_purchasable_reason": "p2p_not_supported",
"marketplace": "p2p",
"image_url": null,
"link": null,
"badge": null,
"attributes": null,
"animation": null,
"nft": null,
"community": null,
"last_checked_at": null,
"created_at": "2026-09-11T16:13:53Z"
},
{
"object": "product",
"id": 24214,
"tag": "39R5SC",
"name": "@stard_sample",
"description": "یوزرنیم نمونه",
"category": "username",
"pricing_type": "auction",
"price": {
"amount": 750000,
"currency": "IRT"
},
"starting_price": {
"amount": 750000,
"currency": "IRT"
},
"auction_end_at": "2026-09-16T09:04:19Z",
"stars_price": null,
"available": true,
"purchasable_via_api": false,
"not_purchasable_reason": "p2p_not_supported",
"marketplace": "p2p",
"image_url": null,
"link": null,
"badge": null,
"attributes": null,
"animation": null,
"nft": null,
"community": null,
"last_checked_at": null,
"created_at": "2026-09-15T09:05:35Z"
}
],
"has_more": true,
"next_offset": 2
}هدرهای پاسخ
x-request-id: req_CrDLZwkMsyARmvYlkkTI
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
x-ratelimit-reset: 1790850720خطاها
| HTTP | code | کی |
|---|---|---|
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-* برمیگردد — جزئیات.
