API Reference
The Urlytics API allows you to programmatically create and manage links, retrieve analytics, and integrate link tracking into your applications.
Introduction
The Urlytics API is organised around REST principles. It accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and methods.
Base URL: All API requests should be made to https://api.urlytics.co.uk/v1
Authentication
The Urlytics API uses API keys to authenticate requests. You can view and manage your API keys in your dashboard settings.
Include your API key in the Authorization header of all requests:
Keep your API keys secure. Do not share them in public repositories or client-side code. If you believe a key has been compromised, regenerate it immediately.
Rate Limits
API requests are rate limited to ensure fair usage and system stability:
| Plan | Requests per minute | Requests per day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 600 | 100,000 |
| Enterprise | Custom | Custom |
Rate limit information is included in response headers:
Error Handling
The API uses standard HTTP status codes to indicate success or failure:
Error responses include a JSON body with details:
Create Link
Create a new tracked short link.
Request Body
| Parameter | Type | Description |
|---|---|---|
destinationrequired | string | The URL to redirect to |
slug | string | Custom slug (auto-generated if not provided) |
domain | string | Custom domain (defaults to urlytics.co.uk) |
title | string | Link title for dashboard organisation |
expires_at | string | ISO 8601 expiration date |
password | string | Password to protect the link |
Example Request
Example Response
Get Link
Retrieve details for a specific link by its ID.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
idrequired | string | The link ID (e.g., lnk_a1b2c3d4) |
List Links
Retrieve a paginated list of all your links.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results (default: 20, max: 100) |
offset | integer | Pagination offset (default: 0) |
domain | string | Filter by domain |
search | string | Search by title or destination |
sort | string | Sort by: created_at, clicks (default: created_at) |
order | string | Order: asc, desc (default: desc) |
Update Link
Update an existing link's destination, title, or settings.
Request Body
| Parameter | Type | Description |
|---|---|---|
destination | string | New destination URL |
title | string | New title |
expires_at | string | New expiration date (null to remove) |
password | string | New password (null to remove) |
archived | boolean | Archive or unarchive the link |
Delete Link
Permanently delete a link and all associated analytics data.
Warning: This action cannot be undone. All click data will be permanently lost.
Link Statistics
Retrieve aggregated statistics for a link.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
period | string | Time period: 24h, 7d, 30d, 90d, all (default: 30d) |
Example Response
Click Events
Retrieve individual click events for a link (Pro plan only).
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results (default: 50, max: 500) |
offset | integer | Pagination offset |
start_date | string | Filter from date (ISO 8601) |
end_date | string | Filter to date (ISO 8601) |
Geographic Data
Retrieve geographic breakdown of clicks by country and city.
List Domains
List all custom domains configured for your account.
Add Domain
Add a new custom domain to your account (Pro plan only).
Request Body
| Parameter | Type | Description |
|---|---|---|
domainrequired | string | The domain to add (e.g., links.example.com) |
Verify Domain
Trigger DNS verification for a pending domain.