API 端点

下面是 flu.lu 可用的 API 端点完整列表,并附有使用方法的技术细节。

创建短链接

POST /api/v1/shorten
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "url": "https://example.com"
}

示例响应

{
  "shortcode": "abc123",
  "short_url": "https://flu.lu/abc123",
  "original_url": "https://example.com"
}

获取链接统计数据

GET /api/v1/stats/{shortcode}
Authorization: Bearer YOUR_API_KEY

示例响应

{
  "shortcode": "abc123",
  "clicks": 125,
  "created_at": "2025-03-23T10:15:30Z",
  "last_clicked": "2025-03-24T08:20:00Z"
}

删除短链接

DELETE /api/v1/delete/{shortcode}
Authorization: Bearer YOUR_API_KEY

示例响应

{
  "message": "链接已成功删除"
}