Shorten URLs via API

Track clicks, set expiration, use custom slugs. One POST and you're done.

curl -X POST https://shorty.celpippractice.workers.dev/v1/shorten \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/very/long/path","slug":"my-link"}'

Features

Custom Slugs

Choose your own short URL path. Brand every link you share.

Click Tracking

See how many times each link was clicked, with timestamps and referrers.

Expiration

Set links to expire after a date or number of clicks. Perfect for campaigns.

Bulk Shortening

Shorten up to 100 URLs in a single API call. Save time at scale.

Pricing

$2.99 / 1,000

First 50 requests free. No credit card required.

Get Your API Key

API Reference

POST /v1/shorten

Shorten a URL. Returns the short link and metadata.

FieldTypeDescription
urlstringThe long URL to shorten (required)
slugstringCustom slug (optional, auto-generated if omitted)
expires_atstringISO 8601 expiration date (optional)
max_clicksintMax clicks before expiry (optional)

GET /v1/stats/:id

Get click stats for a shortened URL.

curl https://shorty.celpippractice.workers.dev/v1/stats/my-link \
  -H "Authorization: Bearer YOUR_KEY"

POST /v1/bulk

Shorten up to 100 URLs at once. Send an array of URL objects.

curl -X POST https://shorty.celpippractice.workers.dev/v1/bulk \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com/a","https://example.com/b"]}'

POST /v1/register

Register for an API key. Send JSON body with email field.