1. Create a short link
POST to /api/shorten with a JSON body:
{
"long_url": "https://example.com/landing?ref=newsletter",
"slug": "optional-custom-slug" // optional
}
On success, you receive:
{
"short_url": "https://url.diet/abcd123",
"key": "abcd123",
"long_url": "https://example.com/landing?ref=newsletter"
}
Rules
long_urlmust begin withhttp://orhttps://.slug(if provided) is normalized to lowercase.- Slug charset:
a-z 0-9 - _, length 1–32. - Collisions on custom slugs return a 409 error.
Status codes
200— short link created.400— invalid URL or slug.409— custom slug already exists.500— internal edge failure.
2. Anonymous analytics
Query aggregated telemetry for a short key with:
GET /api/analytics?key=abcd123&from=YYYY-MM-DD&to=YYYY-MM-DD
from / to are optional; if omitted, the last 7 days are used.
The response includes anonymous summary fields such as total clicks, distinct IP hashes, and high-level geography/device breakdowns. IPs are SHA-256 hashed before storage.
3. UTM parameter logging
When a visitor hits https://url.diet/<key>?utm_source=..., the
following UTM parameters on the short URL are captured per click:
utm_sourceutm_mediumutm_campaignutm_termutm_content
These UTM values are stored alongside the anonymized click event so that you can correlate campaign metadata with edge-level performance, without ever storing raw IP addresses.
4. SEO & health endpoints
/robots.txt— crawl policy and sitemap pointer./sitemap.xml— core public endpoints./status.json— machine-readable service health./.well-known/security.txt— security contact & policy.
For a narrative overview of the platform, visit /about or the Abuse Center to understand how malicious links are handled.