APIドキュメント
ZIPN API を使用して、プログラムで URL を短縮します。
概要
- Base URL:
https://zipn.app/api/v1/shorten - 形式: JSON
- 認証: 現在は認証なしで利用可能
URLを短縮する
POST /api/v1/shorten
リクエストパラメータ:
| パラメータ | 必須 | 説明 |
|---|---|---|
original_url | ✅ | 短縮する元の URL |
custom_code | ❌ | カスタム短縮コード(省略した場合は自動生成) |
expire_duration | ❌ | 有効期限: 24h, 48h, 1week, 1month |
リクエストの例:
curl -X POST https://zipn.app/api/v1/shorten \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com/very-long-url",
"custom_code": "example",
"expire_duration": "1week"
}'成功の応答 (201):
{
"status": "success",
"message": "URL shortened successfully.",
"data": {
"short_url": "https://zipn.app/example/",
"original_url": "https://example.com/very-long-url",
"code": "example",
"expiration_date": "2026-04-21T10:00:00.000Z"
}
}エラー応答:
{
"status": "error",
"message": "This short code is already in use."
}API情報の取得
GET /api/v1/shorten
エンドポイント情報と利用可能なパラメータを返します。