(GET) Get analytics
Retrieve click analytics and performance data for your links. Filter by link, partner, or date range.
Endpoint
GET /analytics
Retrieve click analytics and performance data for your links. Filter by link, partner, or date range to analyze specific segments of your traffic.
Supports flexible filtering and pagination, making it easy to extract insights from large datasets. Results include detailed click information including device, location, browser, and UTM parameters.
GET /analyticsAuthentication
Requires authentication with an API key that has the analyticsRead scope.
Query Parameters
Request Limits
The `take` parameter supports values from 1 to 5,000. Requests above 5,000 are rejected.
Retention Window
Results are clamped to your workspace plan retention window and to the current server time. If `startDate` is earlier than the retention window, the effective start is moved forward. If `endDate` is in the future, the effective end is the current server time.
Examples
curl -X GET "https://api.hoko.to/analytics?linkId=<link_id>&startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z&take=50" \
-H "Authorization: Bearer <API_KEY>"const params = new URLSearchParams({
linkId: '<link_id>',
startDate: '2024-01-01T00:00:00Z',
endDate: '2024-01-31T23:59:59Z',
take: '50'
});
const response = await fetch(`https://api.hoko.to/analytics?${params}`, {
method: 'GET',
headers: {
Authorization: 'Bearer <API_KEY>'
}
});
const analytics = await response.json();[
{
"id": "<click_id>",
"linkId": "<link_id>",
"partnerId": "<partner_id>",
"visitorId": "<visitor_id>",
"visitorSessionId": "session_123",
"referrer": "https://google.com",
"destination": "https://example.com",
"shortId": "abc123",
"utm": {
"source": "google",
"medium": "cpc",
"campaign": "summer"
},
"externalId": "ext_123",
"tenantId": "tenant_123",
"expired": false,
"secured": false,
"scanned": false,
"geoTargeted": false,
"iosTargeted": false,
"androidTargeted": false,
"origin": null,
"pathname": null,
"search": null,
"browserLanguageCode": null,
"browserLanguageRegion": null,
"browserName": "Chrome",
"browserVersion": "120.0",
"osName": "Windows",
"osVersion": "10",
"deviceVendor": null,
"deviceModel": null,
"deviceType": "desktop",
"ipAddress": null,
"continent": null,
"country": "United States",
"countryCode": "US",
"region": null,
"city": "New York",
"district": null,
"zip": null,
"latitude": null,
"longitude": null,
"mobile": false,
"proxy": false,
"hosting": false,
"createdAt": "2024-01-01T00:00:00Z"
}
]