API
Entwickler-API für DirectLink.at
🔒 Premium Feature
Die API ist nur für Nutzer mit einem Premium- oder Jahres-Abo verfügbar.
Mit einem Abo erhältst du:
- ✓ Programmatisches Erstellen von Links
- ✓ Zugriff auf Statistiken via API
- ✓ Bulk-Operationen
- ✓ JSON-Responses
🔒 Premium Feature
The API is only available to users with a Premium or Yearly subscription.
With a subscription you get:
- ✓ Programmatic link creation
- ✓ Access to statistics via API
- ✓ Bulk operations
- ✓ JSON responses
Authentifizierung
Alle API-Anfragen erfordern einen API-Key, der im Header übermittelt wird:
Authorization: Bearer DEIN_API_KEY
Du findest deinen API-Key im Dashboard unter "API-Einstellungen".
Base URL
https://directlink.at/api/v1
Endpoints
Link erstellen
POST /links
Erstellt einen neuen kurzen Link.
Request Body:{
"url": "https://example.com/sehr-lange-url",
"customSlug": "mein-link", // optional, max. 100 Zeichen
"title": "Mein Link" // optional
}
Response:
{
"success": true,
"data": {
"shortUrl": "https://directlink.at/abc123",
"slug": "abc123",
"originalUrl": "https://example.com/sehr-lange-url",
"createdAt": "2026-06-10T12:00:00Z",
"expiresAt": "2026-07-10T12:00:00Z"
}
}
Links auflisten
GET /links
Listet alle deine Links auf.
Query Parameters:page- Seitenzahl (default: 1)limit- Anzahl pro Seite (default: 20, max: 100)
Link-Statistiken
GET /links/{slug}/stats
Ruft detaillierte Statistiken für einen Link ab.
Response:{
"success": true,
"data": {
"slug": "abc123",
"totalClicks": 150,
"uniqueClicks": 120,
"clicksByDay": [...],
"referrers": [...],
"countries": [...],
"browsers": [...]
}
}
Link löschen
DELETE /links/{slug}
Löscht einen Link.
Fehlercodes
| Code | Bedeutung |
|---|---|
| 400 | Ungültige Anfrage |
| 401 | Nicht autorisiert - API-Key fehlt oder ungültig |
| 403 | Verboten - Kein Premium-Abo |
| 404 | Link nicht gefunden |
| 429 | Rate limit überschritten |
| 500 | Serverfehler |
Rate Limits
Die API hat folgende Rate Limits:
- 100 Anfragen pro Minute pro API-Key
- 10.000 Anfragen pro Tag pro API-Key
Bei Überschreitung erhältst du einen 429 Status Code.
Beispiel: cURL
Link erstellen:curl -X POST https://directlink.at/api/v1/links \
-H "Authorization: Bearer DEIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"customSlug": "beispiel"
}'
Statistiken abrufen:
curl -X GET https://directlink.at/api/v1/links/beispiel/stats \
-H "Authorization: Bearer DEIN_API_KEY"
SDKs & Libraries
Offizielle SDKs:
- JavaScript/Node.js (demnächst verfügbar)
- Python (demnächst verfügbar)
- PHP (demnächst verfügbar)
Hilfe bei der Integration? Kontaktiere uns.