ShortGo
功能定价 博客帮助登录
REST · JSON · Webhooks

基于您的链接继续构建

创建品牌链接、生成 QR 码,并在您自己的应用中获取分析数据。接口规范清晰的 REST 端点,全程使用 JSON,并提供用于实时事件的 webhook。

POST /links
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);
201 Created → {"id": 42, "short_url": "https://go.example/launch", …}

身份验证

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.

端点

基础网址

https://shortgo.io/api/v1

所有请求和响应均使用 JSON。出错时返回带有“error”消息和相应 HTTP 状态码的响应。列表端点通过 page 和 per_page 分页。

包含请求和响应结构的完整参考可在您的控制台中查看。

方法端点描述
GET/linksList links with search and filters
POST/links创建短链接
GET/links/{id}获取链接
PATCH/links/{id}Update destination, alias or options
DELETE/links/{id}删除链接
GET/links/{id}/statsClicks, countries, devices and referrers
GET/qr列出 QR 码
POST/qrCreate a dynamic QR code
GET/domainsList your branded domains
GET/campaigns列出营销活动
GET/accountCurrent user and plan usage

验证 webhook 签名

每次推送都包含 X-ShortGo-Timestamp 和 X-ShortGo-Signature 请求头。签名为 sha256= 后接使用您的 webhook 密钥对“timestamp.body”计算的十六进制 HMAC-SHA256。请以恒定时间比较,并拒绝过旧的时间戳。

{
  "event": "link.clicked",
  "created_at": "2026-01-01T12:00:00Z",
  "data": {
    "link_id": 42,
    "country": "DE",
    "device": "mobile",
    "referrer": "instagram.com"
  }
}

我们使用必要的 Cookie 来运行本站。 了解更多