API 문서

숏.한국 URL 단축 API를 사용하여 프로그래밍 방식으로 URL을 단축하세요.

기본 정보

URL 단축 요청

POST /api/v1/shorten

요청 파라미터:

파라미터필수설명
original_url단축할 원본 URL
custom_code사용자 지정 단축 코드 (미입력시 자동 생성)
expire_duration만료 기간: 24h, 48h, 1week, 1month

예제 요청:

curl -X POST https://숏.한국/api/v1/shorten \
  -H "Content-Type: application/json" \
  -d '{
    "original_url": "https://example.com/very-long-url",
    "custom_code": "예제",
    "expire_duration": "1week"
  }'

성공 응답 (201):

{
  "status": "success",
  "message": "URL이 성공적으로 단축되었습니다.",
  "data": {
    "short_url": "https://숏.한국/예제",
    "original_url": "https://example.com/very-long-url",
    "code": "예제",
    "expiration_date": "2026-04-21T10:00:00.000Z"
  }
}

에러 응답:

{
  "status": "error",
  "message": "이미 사용 중인 단축 코드입니다."
}

API 정보 확인

GET /api/v1/shorten

API 엔드포인트 정보와 사용 가능한 파라미터를 반환합니다.