بر پایه لینکهای خود بسازید
لینکهای برندشده بسازید، کد QR تولید کنید و تحلیلها را از برنامههای خود بگیرید. نقاط پایانی REST قابلپیشبینی، JSON در همهجا و webhookها برای رویدادهای لحظهای.
curl -X POST https://shortgo.io/api/v1/links \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://example.com/launch","alias":"launch"}'
const res = await fetch("https://shortgo.io/api/v1/links", { method: "POST", headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://example.com/launch" }), }); const { short_url } = await res.json();
import requests r = requests.post("https://shortgo.io/api/v1/links", headers={"Authorization": f"Bearer {API_KEY}"}, json={"url": "https://example.com/launch"}) print(r.json()["short_url"])
$ch = curl_init("https://shortgo.io/api/v1/links"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey", "Content-Type: application/json"], CURLOPT_POSTFIELDS => json_encode(["url" => "https://example.com/launch"]), ]); $link = json_decode(curl_exec($ch), true);
احراز هویت
Create an API key in your dashboard and send it as a Bearer token in the Authorization header. Keys can be read-only or read/write and revoked at any time.
محدودیتهای نرخ
Limits depend on your plan (requests per minute). Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers; exceeding the limit returns 429.
Webhookها
Subscribe to link.created, link.clicked, link.deleted and overlay.response events. Payloads are signed with HMAC-SHA256 so you can verify they came from us.
نقاط پایانی
نشانی پایه
همه درخواستها و پاسخها از JSON استفاده میکنند. خطاها یک پیام "error" با کد وضعیت HTTP مناسب برمیگردانند. نقاط پایانی فهرست با page و per_page صفحهبندی میشوند.
مرجع کامل با طرحوارههای درخواست و پاسخ در داشبورد شما در دسترس است.
| روش | نقطه پایانی | توضیحات |
|---|---|---|
| GET | /links | List links with search and filters |
| POST | /links | یک لینک کوتاه بسازید |
| GET | /links/{id} | دریافت یک لینک |
| PATCH | /links/{id} | Update destination, alias or options |
| DELETE | /links/{id} | حذف یک لینک |
| GET | /links/{id}/stats | Clicks, countries, devices and referrers |
| GET | /qr | فهرست کدهای QR |
| POST | /qr | Create a dynamic QR code |
| GET | /domains | List your branded domains |
| GET | /campaigns | فهرست کمپینها |
| GET | /account | Current user and plan usage |
تأیید امضاهای webhook
هر تحویل شامل سربرگهای X-ShortGo-Timestamp و X-ShortGo-Signature است. امضا برابر است با sha256= و به دنبال آن HMAC-SHA256 هگز "timestamp.body" با رمز webhook شما. آن را در زمان ثابت مقایسه کنید و مهرهای زمانی قدیمی را رد کنید.
{
"event": "link.clicked",
"created_at": "2026-01-01T12:00:00Z",
"data": {
"link_id": 42,
"country": "DE",
"device": "mobile",
"referrer": "instagram.com"
}
}