Short Links API

Erstellen Sie markenspezifische Kurzlinks mit Aliasen, Ablaufdatum, Passwörtern, Klicklimits und Analysen.

Beliebte Anwendungsfälle
Kampagnen-Tracking

Kurze, markenspezifische Links für UTM-getaggte Kampagnen. Einzigartige Aliase pro Partner zum Leistungsvergleich.

QR-Codes

Druckfreundliche Codes, die Sie später ändern können.

Passwortgeschützt

Schützen Sie sensible Dokumente mit einem einfachen Passwort.

99.9 % Verfügbarkeit
Antwort
25 req/s
0.002 Credits / Anfrage

Create Short Link (Basic)


POST https://api.yeb.to/v1/short-links/create-basic
ParameterTypErf.Beschreibung
api_key string ja Your API key
original_url string ja Target URL (scheme auto-added if missing)
alias string opt. Human alias (1–100, [A-Za-z0-9\-_])
short_code string opt. Custom short code (else auto 7 chars)
password string opt. Optional access password
expires_at ISO 8601 opt. Expiry timestamp
click_limit int opt. Max total clicks
one_time bool opt. Allow only a single click
settings array<{key,value}> opt. Custom metadata

Beispiel

curl -X POST https://api.yeb.to/v1/short-links/create-basic \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "original_url": "https://example.com/pricing",
  "alias": "docs-demo"
}'

Antwortbeispiel

Antwortcodes

CodeBeschreibung
200 SuccessAnfrage erfolgreich verarbeitet.
400 Bad RequestEingabevalidierung fehlgeschlagen.
401 UnauthorizedFehlender / falscher API-Schlüssel.
403 ForbiddenSchlüssel inaktiv oder nicht erlaubt.
429 Rate LimitZu viele Anfragen.
500 Server ErrorUnerwarteter Fehler.

Create Short Link (Advanced)


POST https://api.yeb.to/v1/short-links/create-advanced
ParameterTypErf.Beschreibung
api_key string ja Your API key
original_url string ja Target URL (scheme auto-added if missing)
alias string opt. Human alias (1–100, [A-Za-z0-9\-_])
short_code string opt. Custom short code (else auto 7 chars)
password string opt. Optional access password
expires_at ISO 8601 opt. Expiry timestamp
click_limit int opt. Max total clicks
one_time bool opt. Allow only a single click
settings array<{key,value}> opt. Custom metadata

Beispiel

curl -X POST https://api.yeb.to/v1/short-links/create-advanced \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "original_url": "https://example.com/pricing",
  "alias": "docs-demo",
  "click_limit": 100,
  "expires_at": "2025-12-31T23:59:00Z"
}'

Antwortbeispiel

Antwortcodes

CodeBeschreibung
200 SuccessAnfrage erfolgreich verarbeitet.
400 Bad RequestEingabevalidierung fehlgeschlagen.
401 UnauthorizedFehlender / falscher API-Schlüssel.
403 ForbiddenSchlüssel inaktiv oder nicht erlaubt.
429 Rate LimitZu viele Anfragen.
500 Server ErrorUnerwarteter Fehler.

Get Short Link


POST https://api.yeb.to/v1/short-links/get
ParameterTypErf.Beschreibung
api_key string ja Your API key
code string ja Alias or short_code

Beispiel

curl -X POST https://api.yeb.to/v1/short-links/get \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo"
}'

Antwortbeispiel

Antwortcodes

CodeBeschreibung
200 SuccessAnfrage erfolgreich verarbeitet.
400 Bad RequestEingabevalidierung fehlgeschlagen.
401 UnauthorizedFehlender / falscher API-Schlüssel.
403 ForbiddenSchlüssel inaktiv oder nicht erlaubt.
429 Rate LimitZu viele Anfragen.
500 Server ErrorUnerwarteter Fehler.

Update Short Link


POST https://api.yeb.to/v1/short-links/update
ParameterTypErf.Beschreibung
api_key string ja Your API key
code string ja Alias or short_code to update
original_url string opt. New target URL
alias string opt. New alias
short_code string opt. New short code
password string opt. Set password (empty string to clear)
expires_at ISO 8601 opt. New expiry
click_limit int opt. New limit
one_time bool opt. Enable/disable single-use
advanced_analytics bool opt. Enable/disable advanced analytics
settings array<{key,value}> opt. Replace settings

Beispiel

curl -X POST https://api.yeb.to/v1/short-links/update \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo",
  "click_limit": 100,
  "expires_at": "2025-12-31T23:59:00Z"
}'

Antwortbeispiel

Antwortcodes

CodeBeschreibung
200 SuccessAnfrage erfolgreich verarbeitet.
400 Bad RequestEingabevalidierung fehlgeschlagen.
401 UnauthorizedFehlender / falscher API-Schlüssel.
403 ForbiddenSchlüssel inaktiv oder nicht erlaubt.
429 Rate LimitZu viele Anfragen.
500 Server ErrorUnerwarteter Fehler.

Delete Short Link


POST https://api.yeb.to/v1/short-links/delete
ParameterTypErf.Beschreibung
api_key string ja Your API key
code string ja Alias or short_code

Beispiel

curl -X POST https://api.yeb.to/v1/short-links/delete \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo"
}'

Antwortbeispiel

Antwortcodes

CodeBeschreibung
200 SuccessAnfrage erfolgreich verarbeitet.
400 Bad RequestEingabevalidierung fehlgeschlagen.
401 UnauthorizedFehlender / falscher API-Schlüssel.
403 ForbiddenSchlüssel inaktiv oder nicht erlaubt.
429 Rate LimitZu viele Anfragen.
500 Server ErrorUnerwarteter Fehler.

Short Link Stats


POST https://api.yeb.to/v1/short-links/stats
ParameterTypErf.Beschreibung
api_key string ja Your API key
code string ja Alias or short_code
period enum opt. `7d` | `30d` | `90d` (default: `30d`)
tz string opt. Timezone label (informational)
limit_recent int opt. Recent clicks to return (0–200, default 20)

Beispiel

curl -X POST https://api.yeb.to/v1/short-links/stats \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo",
  "period": "30d",
  "limit_recent": 10
}'

Antwortbeispiel

Antwortcodes

CodeBeschreibung
200 SuccessAnfrage erfolgreich verarbeitet.
400 Bad RequestEingabevalidierung fehlgeschlagen.
401 UnauthorizedFehlender / falscher API-Schlüssel.
403 ForbiddenSchlüssel inaktiv oder nicht erlaubt.
429 Rate LimitZu viele Anfragen.
500 Server ErrorUnerwarteter Fehler.

Short Links API — Practical Guide

Create branded short links with optional password and expiry, manage aliases/codes safely, and read rich stats — without guessing which fields matter in production.

#What this API solves

Teams usually need more than “shorten this URL”. You want safe naming (alias vs code), campaign controls (expiry, one-time, click limits, password), and readable stats that answer “what’s working?”. This suite provides exactly that — with two creation modes (basic vs advanced) so you only pay for analytics you actually use.

#Endpoints & when to use them

#POST /v1/short-links/create-basic — Create link (cheaper)

  • Best for: Operational links where you only need totals & last click (fast & low cost).
  • Output: advanced_analytics=false, total_clicks may be present; no per-country/device buckets.

#POST /v1/short-links/create-advanced — Create link with rich analytics

  • Best for: Campaigns where you’ll later slice by country, device, browser, OS.
  • Output: advanced_analytics=true. The stats endpoint returns buckets.

#POST /v1/short-links/get — Fetch by alias or short_code

  • Ownership enforced: You’ll only see links owned by your API key/user.

#POST /v1/short-links/update — Change URL/alias/code/limits

  • Conflicts handled: Server rejects duplicate alias/short_code across live & soft-deleted rows.
  • Settings: Passing settings replaces the whole key/value set (idempotent).

#POST /v1/short-links/delete — Soft delete by code

  • Tip: Deleted aliases/codes still count for conflict checks to prevent accidental reuse collisions.

#POST /v1/short-links/stats — Summary & buckets

  • Period: 7d | 30d | 90d (default 30d).
  • Recent clicks: up to 200 latest (limit_recent).
  • Buckets: Country/Device/Browser/OS (when advanced_analytics=true).
  • Password metrics: When derivable, returns password_page_views_* and password_attempts_total.
  • Debug mode: Include "debug":true to surface query diagnostics in the response.

#Quick start

# Create a basic link
curl -sX POST "https://api.yeb.to/v1/short-links/create-basic" \
 -H "Accept: application/json" -H "Content-Type: application/json" \
 -d '{ "api_key":"<YOUR_KEY>", "original_url":"https://example.com/pricing", "alias":"docs-demo" }'
# Retrieve stats (30d default) with 10 recent clicks
curl -sX POST "https://api.yeb.to/v1/short-links/stats" \
 -H "Accept: application/json" -H "Content-Type: application/json" \
 -d '{ "api_key":"<YOUR_KEY>", "code":"docs-demo", "limit_recent":10 }'

#Full “everything on” request (covers most options)

Turn features on, then trim to your needs.

POST /v1/short-links/create-advanced
{
  "api_key": "YOUR_KEY",
  "original_url": "https://example.com/launch?utm_source=short",
  "alias": "docs-advanced-demo",
  "short_code": "AB12CDE",
  "password": "letmein",
  "expires_at": "2025-12-31T23:59:00Z",
  "click_limit": 1000,
  "one_time": false,
  "advanced_analytics": true,
  "settings": [
    {"key":"campaign","value":"winter-2025"},
    {"key":"owner","value":"growth-team"}
  ]
}

#Parameters that actually matter

Create / Update

ParamTypeRequiredPractical guidance
original_urlstring (URL)Yes (create)Scheme auto-added if missing; keep UTM here for external analytics.
aliasstringNoReadable path (e.g., /l/black-friday). Great for campaigns.
short_codestringNoFixed-length code. If omitted, server generates 7 chars. Use for printed collateral.
passwordstringNoGate sensitive pages. On update, send empty string to clear.
expires_atISO 8601NoHard stop for promo windows. Combine with stats to prune stale links.
click_limitintNoCap total visits (e.g., limited seats). Pair with one_time for single-use passes.
one_timeboolNoFirst successful click consumes the link.
advanced_analyticsboolNoEnable per-country/device/browser/OS buckets in /stats.
settingsarray<{key,value}>NoFree-form metadata. On update, the set is replaced atomically.

Stats request

ParamTypeRequiredNotes
codestringYesEither the alias or the short_code.
periodenumNo7d | 30d | 90d (default 30d).
limit_recentintNo0–200 (default 20). Returns latest clicks with IP/UA timestamped.
tzstringNoInformational field echoed back (visualization hint).
debugboolNotrue adds query diagnostics to response (helpful in staging).

#Reading & acting on responses

Create (basic vs advanced)

{
  "data": {
    "original_url": "https://example.com/pricing",
    "short_code": "AB12CDE",
    "alias": "docs-demo",
    "public_url": "https://yeb.to/l/docs-demo",
    "expires_at": null,
    "click_limit": null,
    "one_time": false,
    "advanced_analytics": false,
    "total_clicks": 0,
    "created_at": "2025-01-01T12:00:00Z",
    "updated_at": "2025-01-01T12:00:00Z"
  }
}
  • Print/embed: Use public_url on sites or QR codes.
  • Auditing: Keep alias and short_code in your DB for future updates.

Get / Update

{
  "data": {
    "original_url": "https://example.com/pricing",
    "short_code": "AB12CDE",
    "alias": "docs-demo",
    "public_url": "https://yeb.to/l/docs-demo",
    "expires_at": "2025-12-31T23:59:00Z",
    "click_limit": 100,
    "one_time": false,
    "advanced_analytics": false,
    "total_clicks": 0,
    "created_at": "2025-01-01T12:00:00Z",
    "updated_at": "2025-01-10T12:00:00Z"
  }
}
  • Conflicts: If you change alias or short_code to one that exists (even soft-deleted), you’ll get a 422 explaining the conflict.
  • Password: On update, send empty string to clear. Non-empty strings are stored hashed.

Stats

{
  "data": {
    "code": "docs-demo",
    "from": "2025-01-01T00:00:00Z",
    "to":   "2025-01-31T00:00:00Z",
    "tz": "UTC",
    "summary": {
      "total_clicks": 42,
      "last_click_at": "2025-01-30T20:05:00Z",
      "unique_countries": 8,
      "password_page_views_total": 12,
      "password_page_views_unique": 10,
      "password_attempts_total": 3
    },
    "recent_clicks": [
      {"ip":"1.2.3.4","user_agent":"...","ts":"2025-01-30T20:05:00Z"}
    ],
    "by_country": [{"key":"US","count":20}],
    "by_device":  [{"key":"mobile","count":30}],
    "by_browser": [{"key":"Chrome","count":25}],
    "by_os":      [{"key":"Android","count":18}]
  }
}
  • Basic vs Advanced: Buckets populate only when the link was created with advanced_analytics=true and underlying tables exist.
  • Recent list: Use it for moderation/debugging; don’t store full UA/IP long-term if you don’t need them.

#Practical recipes

  • Campaign naming: Use alias for human-readable slugs (/l/summer-sale), keep short_code for printed QR where length matters.
  • Time-boxed promos: Set expires_at and click_limit. After the window, update the link to a “campaign over” page.
  • Single-use access: Combine one_time=true with a password. Track attempts via /stats password metrics.
  • Attribution: Include UTMs in original_url. The API doesn’t change your query string.
  • Governance: Store settings like campaign, owner, cost_center for internal reporting.

#Errors & safeguards

  • 422 — Validation (missing original_url, code, or alias/code conflict).
  • 404 — Not found (wrong code or not owned by your key/user).
  • Ownership: All read/write endpoints scope by API key/user; non-owned links behave as “not found”.

#API Changelog (Short Links)

2025-11-05
Stats diagnostics. Added optional debug flag to /stats response for query introspection.
2025-11-03
Password telemetry. Surfacing password_page_views_* and password_attempts_total when derivable.
2025-10-28
Conflict hardening. Update now checks duplicates across live & soft-deleted links; clearer 422 messages.
2025-10-20
Advanced analytics path. Split creation into create-basic and create-advanced with bucketed stats support.

Use the endpoint playgrounds on this page to test payloads and lock defaults (alias pattern, expiry policy, analytics mode).

#Copy-ready cURL (common flows)

# Create (basic)
curl -sX POST "https://api.yeb.to/v1/short-links/create-basic" -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","original_url":"https://example.com/pricing","alias":"docs-demo"}'

# Create (advanced)
curl -sX POST "https://api.yeb.to/v1/short-links/create-advanced" -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","original_url":"https://example.com/pricing","alias":"docs-demo","click_limit":100,"expires_at":"2025-12-31T23:59:00Z"}'

# Get
curl -sX POST "https://api.yeb.to/v1/short-links/get" -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","code":"docs-demo"}'

# Update
curl -sX POST "https://api.yeb.to/v1/short-links/update" -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","code":"docs-demo","click_limit":100,"expires_at":"2025-12-31T23:59:00Z"}'

# Stats
curl -sX POST "https://api.yeb.to/v1/short-links/stats" -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","code":"docs-demo","period":"30d","limit_recent":10}'

# Delete
curl -sX POST "https://api.yeb.to/v1/short-links/delete" -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","code":"docs-demo"}'

Häufig gestellte Fragen

MaxMind GeoLite2-Daten sind in der Regel auf Stadtebene für 65–70 % der IPv4-Adressen weltweit genau.

Aus Datenschutz- und Einfachheitsgründen normalisieren wir alle „nicht verfügbar"-Zustände (abgelaufen, verbraucht, deaktiviert, Klicklimit erreicht) auf 404.

Ja, wenn der neue alias/short_code in beiden Spalten eindeutig ist. Die API erzwingt globale Eindeutigkeit.

Der Standard-Burst beträgt 20 Anfragen/s pro API-Schlüssel (kann je nach Plan variieren). Tägliche und monatliche Kontingente können ebenfalls gelten.

Das Erstellen eines Links verbraucht Credits. Das Anzeigen von Statistiken ebenfalls. Passwort-Aufrufe/-Versuche selbst werden aufgezeichnet, aber nicht einzeln abgerechnet.

Eindeutige Klicks werden anhand unterschiedlicher IP-Adressen geschätzt, die vor dem aktuellen Ereignis beobachtet wurden.

Nur Sie. Zugriffsprüfungen gleichen Ihre user_id (Web) oder einen Ihrer API-Schlüssel (API) ab. Anfragen von anderen werden als 404 aufgelöst.

Ja. Jede Anfrage, auch solche mit Fehlern, verbraucht Credits. Ihre Credits sind an die Anzahl der Anfragen gebunden, unabhängig von Erfolg oder Misserfolg. Wenn der Fehler eindeutig auf ein Plattformproblem unsererseits zurückzuführen ist, stellen wir die betroffenen Credits wieder her (keine Barerstattung).

Kontaktieren Sie uns unter [email protected]. Wir nehmen Feedback ernst—wenn Ihr Fehlerbericht oder Ihre Funktionsanfrage sinnvoll ist, können wir die API schnell korrigieren oder verbessern und Ihnen 50 kostenlose Credits als Dankeschön gewähren.

Es hängt von der API und manchmal sogar vom Endpoint ab. Einige Endpoints nutzen Daten aus externen Quellen, die strengere Limits haben können. Wir setzen auch Limits durch, um Missbrauch zu verhindern und unsere Plattform stabil zu halten. Prüfen Sie die Dokumentation für das spezifische Limit jedes Endpoints.

Wir arbeiten mit einem Creditsystem. Credits sind vorausbezahlte, nicht erstattungsfähige Einheiten, die Sie für API-Aufrufe und Tools ausgeben. Credits werden nach dem FIFO-Prinzip (älteste zuerst) verbraucht und sind 12 Monate ab Kaufdatum gültig. Das Dashboard zeigt jedes Kaufdatum und dessen Ablauf an.

Ja. Alle gekauften Credits (einschließlich Teilguthaben) sind 12 Monate ab Kauf gültig. Ungenutzte Credits verfallen automatisch und werden am Ende der Gültigkeitsdauer dauerhaft gelöscht. Verfallene Credits können nicht wiederhergestellt oder in Bargeld oder anderen Wert umgewandelt werden. Übergangsregel: Vor dem 22. Sep. 2025 gekaufte Credits gelten als am 22. Sep. 2025 gekauft und verfallen am 22. Sep. 2026 (sofern beim Kauf kein früherer Ablauf angegeben wurde).

Ja—innerhalb ihrer Gültigkeitsdauer. Ungenutzte Credits bleiben verfügbar und werden von Monat zu Monat übertragen, bis sie 12 Monate nach dem Kauf verfallen.

Credits sind nicht erstattungsfähig. Kaufen Sie nur, was Sie brauchen—Sie können jederzeit nachladen. Wenn ein plattformseitiger Fehler eine fehlgeschlagene Abbuchung verursacht, können wir die betroffenen Credits nach Prüfung wiederherstellen. Keine Barerstattung.

Preise werden in Credits angegeben, nicht in Dollar. Jeder Endpoint hat seine eigenen Kosten—siehe das Abzeichen „Credits / Anfrage" oben. Sie wissen immer genau, was Sie ausgeben.
← Zurück zu den APIs