API-Dokumentation

Verwenden Sie die API ZIPN, um URLs programmgesteuert zu kรผrzen.

รœbersicht

Gรคste kรถnnen alle 24 Stunden bis zu 3 Links kostenlos erstellen.

Authentifizierung (API-Schlรผssel)

Melden Sie sich an, erstellen Sie in Ihrem Profil einen API-Schlรผssel und senden Sie ihn im Request-Header. Links werden dann ohne Ablauf unter Ihrem persรถnlichen Code erstellt, und Sie kรถnnen sie im Dashboard bearbeiten und Statistiken ansehen.

Authorization: Bearer sk_short_...

Kรผrzen Sie eine URL

POST /api/v1/shorten

Anforderungsparameter:

ParameterErforderlichBeschreibung
original_urlโœ…Ursprรผngliche URL zum Kรผrzen
custom_codeโŒBenutzerdefinierter Kurzcode (wird automatisch generiert, wenn er weggelassen wird)
expire_durationโŒGรผltigkeit: 24h, 48h, 1week, 1month
code_idโŒMit API-Schlรผssel: ID des zu verwendenden persรถnlichen Codes (Standard: Hauptcode). Mit temp wird ein temporรคrer Link erstellt, der im Dashboard verwaltet wird.

Beispielanfrage:

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"
  }'

Erfolgsantwort (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"
  }
}

Anfrage mit API-Schlรผssel:

curl -X POST https://zipn.app/api/v1/shorten \
  -H "Authorization: Bearer sk_short_..." \
  -H "Content-Type: application/json" \
  -d '{
    "original_url": "https://example.com/very-long-url",
    "custom_code": "example"
  }'

Erfolgsantwort mit API-Schlรผssel (201):

{
  "status": "success",
  "message": "URL shortened successfully.",
  "data": {
    "short_url": "https://zipn.app/mycode/example/",
    "original_url": "https://example.com/very-long-url",
    "code": "example",
    "expiration_date": "2126-03-28T10:00:00.000Z",
    "username": "mycode",
    "user_code_id": 12,
    "is_temp": false
  }
}

Fehlerantwort:

{
  "status": "error",
  "message": "This short code is already in use."
}

Holen Sie sich API-Informationen

GET /api/v1/shorten

Gibt Endpunktinformationen und verfรผgbare Parameter zurรผck.