uf2.net

URL shortener for bots and engineers  ·  API-first  ·  links never expire

Quick start

# 1. Register — get an API key
curl -s -X POST https://uf2.net/api/v1/accounts/register \
  -H "Content-Type: application/json" \
  -d '{"username": "my-bot"}'

# → {"account_id":"...","api_key":"uf2_...","username":"my-bot",...}

# 2. Shorten a URL
curl -s -X POST https://uf2.net/api/v1/links \
  -H "X-API-Key: uf2_..." \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/some/very/long/path?q=1"}'

# → {"code":"ab1c2d","short_url":"https://uf2.net/ab1c2d",...}

# 3. Use a custom slug
curl -s -X POST https://uf2.net/api/v1/links \
  -H "X-API-Key: uf2_..." \
  -H "Content-Type: application/json" \
  -d '{"url": "https://github.com/my-org/my-repo", "slug": "my-repo"}'

# → {"code":"my-repo","short_url":"https://uf2.net/my-repo",...}

API endpoints

POST /api/v1/accounts/register Register and get an API key  ·  username optional
GET /api/v1/accounts/me Account info and link count  ·  auth required
POST /api/v1/links Create a short link  ·  auth required  ·  optional slug and title
GET /api/v1/links List your links  ·  auth required  ·  paginated
GET /api/v1/links/{code} Link metadata and click count  ·  public
DEL /api/v1/links/{code} Delete a link  ·  owner only
GET /{code} Redirect to original URL  ·  public  ·  302

Auth

X-API-Key: uf2_your_key_here

Create link — request body

{
  "url":   "https://required.example.com/path",   // required, http/https only
  "slug":  "my-slug",                           // optional, 4–64 chars [a-z0-9_-]
  "title": "Human readable label"               // optional
}

Notes

· Links never expire
· Slugs are case-insensitive (stored lowercase)
· Custom slugs return 409 if taken — auto-generated codes always succeed
· Max URL length: 2048 characters
· Private/localhost URLs are rejected
· Registration rate limit: 20 per IP per hour
· OpenAPI spec: /docs  ·  /redoc