公共API

我们的公共API允许您以编程方式缩短URL。不需要API密钥或身份验证。

📥 POST /api/links

发送单个对象或对象数组以缩短URL。

{
  "domain": "clc.is",
  "target_url": "https://example.com",
  "slug": "custom", // 可选
  "expired_url": "https://expired.example.com", // 可选
  "expired_hours": 48 // 可选 (0 = 不过期)
}

🔁 响应:

{
  "input": { ... },
  "slug": "custom",
  "url": "https://clc.is/custom",
  "is_generated": false
}

🌐 GET /api/domains

返回一个可用域名的数组以缩短链接。

["clc.is", "alt1.com", "alt2.com"]

⚠️ 错误处理

📦 批量处理

要一次提交最多5000个URL,请使用批量页面或将条目数组发送到/api/links