---
title: خرید استارز تلگرام با API | Stard API
url: https://stard-market.ir/docs/products/stars
markdown: https://stard-market.ir/docs/products/stars.md
language: fa
updated: 2026-11-18
description: قیمت لحظه‌ای استارز را بگیر و با یک درخواست، استارز را مستقیم به یوزرنیم تلگرام گیرنده بفرست؛ ارسال خودکار است.
---

# خرید استارز تلگرام با API

> قیمت لحظه‌ای استارز را بگیر و با یک درخواست، استارز را مستقیم به یوزرنیم تلگرام گیرنده بفرست؛ ارسال خودکار است.

**پاسخ کوتاه:** بله. با `POST /api/v1/orders` و بدنه‌ی `{"type":"stars","quantity":500,"recipient":"@username"}` استارز تلگرام خریده و خودکار به گیرنده فرستاده می‌شود؛ مبلغ از کیف پول Stard کسر می‌شود.

## قیمت

```bash
curl "https://stard-market.ir/api/v1/stars/price?quantity=500" \
  -H "Authorization: Bearer $STARD_API_KEY"
```

```javascript
const res = await fetch("https://stard-market.ir/api/v1/stars/price?quantity=500", {
  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);
```

```typescript
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/stars/price?quantity=500", {
  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();
```

```python
import os
import requests

r = requests.get(
    "https://stard-market.ir/api/v1/stars/price?quantity=500",
    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
<?php
$ch = curl_init("https://stard-market.ir/api/v1/stars/price?quantity=500");
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);
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://stard-market.ir/api/v1/stars/price?quantity=500", 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))
}
```

**پاسخ**

```json
{
  "object": "stars_price",
  "quantity": 500,
  "unit_price": 4382,
  "amount": 2191000,
  "currency": "IRT",
  "updated_at": "2026-10-01T10:31:49Z"
}
```

## خرید

حداقل ۵۰ استارز. گیرنده فقط با یوزرنیم تلگرام (نه آیدی عددی).

```bash
curl -X POST "https://stard-market.ir/api/v1/orders" \
  -H "Authorization: Bearer $STARD_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: stars-7781" \
  -d '{"type": "stars", "quantity": 500, "recipient": "@username"}'
```

```javascript
const res = await fetch("https://stard-market.ir/api/v1/orders", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STARD_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": "stars-7781",
  },
  body: JSON.stringify({
    "type": "stars",
    "quantity": 500,
    "recipient": "@username"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);
```

```typescript
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/orders", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STARD_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": "stars-7781",
  },
  body: JSON.stringify({
    "type": "stars",
    "quantity": 500,
    "recipient": "@username"
  }),
});
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();
```

```python
import os
import requests

r = requests.post(
    "https://stard-market.ir/api/v1/orders",
    headers={
    "Authorization": f"Bearer {os.environ['STARD_API_KEY']}",
    "Idempotency-Key": "stars-7781",
    },
    json={
        "type": "stars",
        "quantity": 500,
        "recipient": "@username"
    },
    timeout=20,
)
data = r.json()
if r.status_code >= 400:
    raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)
```

```php
<?php
$ch = curl_init("https://stard-market.ir/api/v1/orders");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("STARD_API_KEY"),
    "Content-Type: application/json",
    "Idempotency-Key: stars-7781",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "type" => "stars",
    "quantity" => 500,
    "recipient" => "@username"
  ]),
  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);
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{"type": "stars", "quantity": 500, "recipient": "@username"}`)
	req, _ := http.NewRequest("POST", "https://stard-market.ir/api/v1/orders", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("STARD_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Idempotency-Key", "stars-7781")
	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))
}
```

## تحویل

استارز با موتور خودکار Stard به‌صورت آنی (معمولاً کمتر از یک دقیقه) به حساب گیرنده می‌رسد. وضعیت را با [`GET /orders/{id}`](https://stard-market.ir/docs/reference/orders-get) دنبال کن؛ وقتی `status` برابر `completed` شد، تحویل انجام شده است.

## پرسش‌های رایج

**حداقل خرید استارز از API چقدر است؟**

۵۰ استارز.

**می‌شود به آیدی عددی استارز فرستاد؟**

نه؛ تلگرام استارز را فقط به یوزرنیم می‌فرستد.
