linq records every redirect request as a Visit and makes that data immediately queryable through the analytics API. Every redirect — whether it hits a rule, falls back to the default destination, or resolves to no link at all — produces a visit record the moment the 302 is issued. The recording is fire-and-forget: a visit insert never delays a redirect, and a failed insert never turns a working link into an error. The result is a complete, low-latency audit trail of link traffic that you can query, filter, and slice without ever touching raw database tables.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/org-quicko/linq/llms.txt
Use this file to discover all available pages before exploring further.
What a Visit Captures
Each visit record carries the following fields:Unique identifier. UUIDv7, time-sortable.
The link that resolved the visit.
null for orphan visits — unknown slug, archived link, expired link, or the root path.The domain that received the request.
The exact slug the visitor requested. Empty string for root-path visits.
When the visit was recorded, in UTC.
Whether the visitor was detected as a bot or link-preview crawler, decided once at ingest based on User-Agent pattern matching. A request with no User-Agent at all is treated as a bot. Human and bot counts are tracked and reported separately on every link and in every analytics query.
Detected from the User-Agent. Used by rule matching and available as an analytics dimension.
Operating system, lowercased open vocabulary (e.g.
"macos", "windows", "android"). null when it could not be determined.Browser name, lowercased open vocabulary (e.g.
"chrome", "safari", "firefox"). null when it could not be determined.Raw User-Agent header value.
null if the request carried none.The referring URL as sent in the
Referer header — never the client IP address. null if absent.The destination URL the visitor was ultimately sent to, after rule matching.
null for orphan visits that resolved to no link.The incoming query string at redirect time, as a key-to-values map (
{ key: string[] }). Always captured regardless of the link’s forward_query setting. null when the request carried no query parameters.linq is privacy-first by design: no geolocation, no IP addresses, no cookies. Ever. The client’s IP address is not logged, not stored in the visit row, and not accessible through any API endpoint. See
docs/adr/0001 and docs/adr/0003 in the source repository for the rationale.Human vs Bot Traffic
linq distinguishes human visitors from bots using User-Agent pattern matching at ingest time. Every link response includes separatehuman_visits and bot_visits counters. Every analytics query accepts a bot filter ("true" | "false" | "any", default "any") so you can focus on human traffic, inspect bot activity, or view the combined total.
Link-preview crawlers (Slack, iMessage, Twitter Cards) are classified as bots — their requests trigger the OG preview HTML response rather than a 302, and their hits are counted under bot_visits.
Orphan Visits
A visit on an active domain that resolved to no active link is an orphan visit — thelink_id is null. Orphan visits arise from:
- An unknown slug (no matching link on the domain)
- An archived link (slug still reserved but not redirecting)
- An expired link (past its
expires_attimestamp) - The root path
/of a domain with nobase_path_redirect
orphan=true query parameter. They are also visible in the UI’s Orphans page.
Pre-Aggregated Rollups
linq maintains two rollup tables —visit_days and visit_counts — using Postgres triggers on insert. Every time a visit is recorded, the triggers update these tables automatically with no application-level rollup job that could fall behind or miss rows.
visit_counts— one indexed row per link with cumulative human and bot totals. Powers thehuman_visitsandbot_visitsfields on every link response.visit_days— aggregated counts per day, per dimension (platform, OS, browser, referer, slug, destination). Powers the timeseries and breakdown analytics endpoints without requiring a fullvisitstable scan.
Analytics API Endpoints
All analytics endpoints require a valid API key and accept a common set of query parameters.Common Query Parameters
Start of the date range (inclusive). Absent means all time — only allowed on the rollup path (no dimension filters).
End of the date range (inclusive). Defaults to today.
Restrict results to one or more specific links.
Restrict results to one or more domains.
When
"true", restrict to orphan visits only. When "false" (default), orphan visits are included in the totals but accessible separately via the orphans field on the summary response.Filter to bot-only traffic, human-only traffic, or all traffic combined.
Filter to
android, ios, or desktop. Dimension filter — forces a raw visit scan; requires from within 366 days of to.Filter by OS name (lowercased, open vocabulary). Dimension filter.
Filter by browser name (lowercased, open vocabulary). Dimension filter.
Filter by referer host. Dimension filter.
GET /api/v1/analytics/summary
Returns aggregate visit totals for the selected scope.
Total visits (human + bot).
Visits not flagged as bots.
Visits flagged as bots or link-preview crawlers.
Visits that resolved to no active link. Always
0 when a link_id filter is applied.GET /api/v1/analytics/timeseries
Returns daily visit counts over time, in ascending chronological order. The only analytics endpoint that returns data as a time-ordered series suitable for charting.
StatsBucket):
GET /api/v1/analytics/breakdown
Returns visit counts grouped by a chosen dimension, ordered by total volume descending.
One of:
referer, os, browser, platform, slug, destination.StatsBucket):
key is the dimension value. An absent or unrecorded value (e.g. a visit with no referer) uses the sentinel string "(none)" as its key.
GET /api/v1/visits
Returns the raw paginated visit log. Useful for export, auditing, or building custom aggregations.
GET /api/v1/visits filters on precise ISO 8601 datetime values (from / to are instants, not dates).
Visit list query parameters
Visit list query parameters
Restrict to one specific link.
Restrict to one specific domain.
Lower bound on
occurred_at (inclusive).Upper bound on
occurred_at (inclusive).Filter by bot classification.
Filter by platform.
Filter by OS name (lowercased).
Filter by browser name (lowercased).
When
"true", return only orphan visits.Analytics Dimensions Reference
The breakdown endpoint supports these dimensions:| Dimension | Description |
|---|---|
platform | android, ios, or desktop |
os | Operating system (open vocabulary, lowercased) |
browser | Browser name (open vocabulary, lowercased) |
referer | Referring host extracted from the Referer header |
slug | The slug that was requested |
destination | The destination URL the visit resolved to |