Back to articles
Dub.co Has a Free API: Open-Source Link Management with Analytics for Developers
How-ToTools

Dub.co Has a Free API: Open-Source Link Management with Analytics for Developers

via Dev.to TutorialAlex Spinov

What is Dub? Dub is an open-source link management platform — like Bitly, but with developer-first features: analytics, custom domains, QR codes, and a powerful API. Built with Next.js. Free tier: 1,000 links, 5,000 tracked clicks/month. The REST API export DUB_TOKEN = "your-api-key" Create Short Link curl -X POST "https://api.dub.co/links" \ -H "Authorization: Bearer $DUB_TOKEN " \ -H "Content-Type: application/json" \ -d '{ "url": "https://dev.to/aandrew_n/my-long-article-url", "domain": "dub.sh", "key": "my-article", "externalId": "article_123" }' Result: https://dub.sh/my-article Get Link Analytics # Click count curl "https://api.dub.co/analytics?linkId=LINK_ID&event=clicks" \ -H "Authorization: Bearer $DUB_TOKEN " # Clicks by country curl "https://api.dub.co/analytics?linkId=LINK_ID&event=clicks&groupBy=country" \ -H "Authorization: Bearer $DUB_TOKEN " # Clicks by device curl "https://api.dub.co/analytics?linkId=LINK_ID&event=clicks&groupBy=device" \ -H "Authorization: Bearer $DUB

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles