اطلاعات و ریاکشنهای پست
POST
/api/v1/services/post-infoscope: prices:readاحراز هویت: Bearerlive و test
عنوان کانال، متن، بازدید و ریاکشنهای فعلی پست (ایموجی، استارزی و سفارشی) بههمراه ریاکشنهای مجاز کانال (allowed؛ null یعنی محدودیتی نیست). اگر status=pending بود، ۱ تا ۳ ثانیه بعد همان درخواست را تکرار کن. نتیجه ۱۰ دقیقه کش میشود؛ fresh=true کش را دور میزند.
درخواست
| نام | محل | نوع | توضیح | |
|---|---|---|---|---|
Authorization | header | string | الزامی | Bearer sk_live_… یا Bearer sk_test_… |
بدنه (JSON)
| فیلد | نوع | توضیح | |
|---|---|---|---|
link | string | الزامی | لینک پست: https://t.me/channel/123 |
fresh | boolean | اختیاری | نادیده گرفتن کش |
نمونه
curl -X POST "https://stard-market.ir/api/v1/services/post-info" \
-H "Authorization: Bearer $STARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"link": "https://t.me/your_channel/42"}'const res = await fetch("https://stard-market.ir/api/v1/services/post-info", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"link": "https://t.me/your_channel/42"
}),
});
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/services/post-info", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"link": "https://t.me/your_channel/42"
}),
});
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.post(
"https://stard-market.ir/api/v1/services/post-info",
headers={
"Authorization": f"Bearer {os.environ['STARD_API_KEY']}",
},
json={
"link": "https://t.me/your_channel/42"
},
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/services/post-info");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("STARD_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"link" => "https://t.me/your_channel/42"
]),
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"
"strings"
)
func main() {
body := strings.NewReader(`{"link": "https://t.me/your_channel/42"}`)
req, _ := http.NewRequest("POST", "https://stard-market.ir/api/v1/services/post-info", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("STARD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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": "post_info",
"link": "https://t.me/your_channel/42",
"allowed": [
"❤",
"👍",
"🔥",
"🎉",
"custom"
],
"status": "done",
"title": "Your Channel",
"text": "متن پست…",
"views": 12840,
"reactions": [
{
"emoji": "👍",
"count": 412
},
{
"emoji": "❤",
"count": 190
},
{
"paid": true,
"count": 25
},
{
"custom_id": "5413794461152978282",
"count": 12
}
],
"paid_enabled": true
}خطاها
| HTTP | code | کی |
|---|---|---|
400 | invalid_request | لینک پست معتبر نیست |
403 | insufficient_scope | کلید scope prices:read را ندارد |
401 | invalid_api_key / missing_api_key / api_key_revoked / api_key_expired | کلید نیامده، نامعتبر، باطل یا منقضی است |
429 | rate_limit_exceeded | سقف درخواست در دقیقه پر شده؛ بعد از Retry-After ثانیه دوباره بفرست |
محدودیت نرخ
پیشفرض ۶۰ درخواست در دقیقه برای هر کلید (قابل تنظیم در داشبورد). وضعیت در هدرهای X-RateLimit-* برمیگردد — جزئیات.
