o.cheap API

Manage your links from code. Create an API key on your management page (it’s shown once). Send it as Authorization: Bearer oc_…. Limit: 600 requests/hour. Links are screened for abuse exactly like the dashboard.

Links

GET    https://o.cheap/api/v1/links                    list the main link + all links
POST   https://o.cheap/api/v1/links                    create {path, dest, utm?, app_open?, ios_url?, android_url?, tags?, folder?}
GET    https://o.cheap/api/v1/links/{path}             one link   (use _root for the main link)
PATCH  https://o.cheap/api/v1/links/{path}             update any field
DELETE https://o.cheap/api/v1/links/{path}             delete
POST   https://o.cheap/api/v1/bulk                     {csv: "path,dest,tags\n…"}  up to 200 rows

Analytics

GET https://o.cheap/api/v1/links/{path}/stats?days=30  totals, unique visitors, daily series, referrers, countries, devices
GET https://o.cheap/api/v1/stats?days=30               all links
GET https://o.cheap/api/v1/clicks.csv?path=*&days=90    raw clicks as CSV

Example

curl -X POST https://o.cheap/api/v1/links \
  -H "Authorization: Bearer oc_YOUR_KEY" -H "content-type: application/json" \
  -d '{"path":"spring","dest":"https://shop.example.com/sale",
       "utm":{"utm_source":"newsletter","utm_medium":"email","utm_campaign":"spring"},
       "tags":["promo"],"folder":"Campaigns"}'

Behavior

• UTM parameters are added on redirect unless the destination already has them; query parameters on the short link are passed through.
• On phones, links to YouTube, Instagram, TikTok, X, Spotify, Amazon, the App Store, Google Play and other apps open the native app when it’s installed (turn off with app_open:false). Custom ios_url / android_url deep links override this and fall back to dest.
• Path links ($1/yr) have one link (_root); subdomains ($20/yr) hold unlimited links.