API Documentation
Welcome to the URL Shortener API. This API allows you to programmatically create short links and retrieve detailed tracking analytics for your campaigns. You can also create links on your own branded domains once they're verified in the dashboard.
Base URL: https://snip.tendstoinfinity.com
Authentication
All API requests must be authenticated using an API Key. You can pass this key in the Authorization header.
Note: Keep your API key secure. Do not share it in client-side code (browsers).
/api/domains
List every custom domain attached to your account, along with its verification status. Use the id of a verified domain as the domainId when creating a short link.
verified: true can be used for link creation. Domains that are still pending will return a 400 if passed as domainId. /api/urls
Create a new short URL. Accepts a long URL and optional parameters for customization, including an optional verified branded domain.
Body Parameters
- originalUrlstring, requiredThe destination URL you want to shorten.
- customCodestring, optionalA custom alias for your link (e.g.
summer-sale). Must be unique within the chosen domain. - domainIdstring, optionalThe
idof one of your verified custom domains (from GET /api/domains). If omitted ornull, the link is created on the default shortener host. - titlestring, optionalA descriptive title for dashboard organization.
- descriptionstring, optionalFree-form notes attached to the link.
customCode is already taken on that domain. The same code can exist on different domains (e.g. go.brand-a.com/sale and go.brand-b.com/sale). /api/stats/{id}
Retrieve detailed analytics for a specific short link, including click counts, referrers, and geographic data.
Path Parameters
- idstring, requiredThe internal ID of the URL (returned from
POST /api/urls).
Authorization: Bearer YOUR_API_KEYcurl https://snip.tendstoinfinity.com/api/domains \
-H 'Authorization: Bearer YOUR_API_KEY'[
{
"id": "clt_abc123",
"hostname": "go.yourdomain.com",
"verified": true,
"verification_token": "verify_xyz...",
"created_at": "2024-03-20T10:00:00Z"
}
]curl -X POST https://snip.tendstoinfinity.com/api/urls \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"originalUrl": "https://example.com/long-url",
"customCode": "summer-sale",
"domainId": "clt_abc123"
}'{
"id": "clt_url456",
"code": "summer-sale",
"short_url": "https://go.yourdomain.com/summer-sale",
"original_url": "https://example.com/long-url",
"domain_id": "clt_abc123",
"created_at": "2024-03-20T10:00:00Z"
}curl https://snip.tendstoinfinity.com/api/stats/clt_url456 \
-H 'Authorization: Bearer YOUR_API_KEY'{
"code": "summer-sale",
"totalClicks": 1250,
"countries": [
{ "name": "United States", "value": 500 },
{ "name": "Germany", "value": 200 }
],
"referrers": [
{ "name": "twitter.com", "value": 800 },
{ "name": "Direct", "value": 450 }
]
}