UniLink API: Analytics Endpoint (Pull Traffic and Revenue Data)

By UniLink May 02, 2026 9 min read
UniLink API: Analytics Endpoint (Pull Traffic and Revenue Data)


UniLink API: Analytics Endpoint (Pull Traffic and Revenue Data)

The /analytics endpoint gives you programmatic access to your UniLink traffic, click, and revenue data — build custom dashboards and automated client reports without manual exports.

  • Pull summary metrics, per-page stats, link click counts, and conversion data via four dedicated sub-endpoints.
  • All endpoints accept start_date, end_date, and granularity (day/week/month) parameters.
  • Revenue figures are returned in cents — divide by 100 for display in your reporting tools.

UniLink's analytics data is most valuable when you can combine it with your other business metrics. The /analytics endpoint makes that possible — pipe your page views, link clicks, and revenue numbers into a Google Data Studio report, a custom Notion dashboard, or an automated PDF your agency sends to clients every month. All four sub-endpoints accept consistent date range and granularity parameters, so once you understand the pattern for one endpoint you can apply it to all of them.

What the Analytics Endpoint Does

The analytics endpoint exposes four read-only sub-paths. GET /analytics/summary returns aggregate metrics for the requested date range: total page views, unique visitors, total link clicks, and total revenue. This is the top-level health check — ideal for executive dashboards and weekly summary emails. The granularity parameter breaks the summary down into time series data: pass day to get a metric per day, week for weekly totals, or month for monthly rollups. The time series is returned as an array of objects in chronological order, each with a date key and the metric values for that period.

The GET /analytics/pages/{id} endpoint returns metrics for a single UniLink page. Page-level data includes views, unique visitors, bounce rate, average time on page, and click-through rate (clicks divided by views). Pass the page ID from GET /pages to identify which page you are querying. This endpoint is particularly useful for agencies managing multiple client pages — each client's report pulls from their specific page ID rather than a cross-account summary.

The GET /analytics/links endpoint returns click counts for every link on your page, sorted by click volume descending. Each entry includes the link ID, the destination URL, the link label, and the total clicks for the period. The GET /analytics/conversions endpoint returns conversion events — including product purchases, form submissions, and email opt-ins — aggregated by conversion type, with total count and total revenue per type. Together, links and conversions give you the attribution data needed to understand which content drives both engagement and revenue.

How to Get Started

  1. Generate a read-scope API key from Settings → API in your dashboard at app.unilink.us. Analytics endpoints are read-only — you do not need write or admin scope.
  2. Make your first summary request for the last 30 days: GET /analytics/summary?start_date=2026-04-06&end_date=2026-05-06. Review the response fields and confirm the numbers match what you see in the dashboard.
  3. Add granularity to the same request: GET /analytics/summary?start_date=2026-04-06&end_date=2026-05-06&granularity=day. You will receive an array of 30 daily data points — this is the format to feed into a chart.
  4. Fetch your page ID from GET /pages, then query page-level analytics: GET /analytics/pages/{id}?start_date=2026-04-01&end_date=2026-04-30.
  5. Pull link click data to see which links are performing: GET /analytics/links?start_date=2026-04-01&end_date=2026-04-30. Sort the response by clicks descending to find your top-performing links.

How to Use the Analytics Endpoint

  1. Summary report: GET /analytics/summary?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&granularity=week — weekly breakdowns work well for recurring client reports and trend analysis.
  2. Page-level metrics: GET /analytics/pages/{id}?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD — compare the same date range across multiple page IDs to benchmark performance across clients or campaigns.
  3. Link click leaderboard: GET /analytics/links?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD — the response is sorted by click count; take the top 5 entries to build a "top links this month" widget.
  4. Conversion funnel: GET /analytics/conversions?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD — compare views (from summary) to conversions (from this endpoint) to calculate an overall conversion rate for the period.
  5. Time series chart data: Add &granularity=day to any endpoint that returns aggregate values to get a day-by-day breakdown. Map the date field to your chart's X axis and the metric value to the Y axis.

Key Settings

SettingWhat It DoesRecommended
start_dateBeginning of the reporting window (ISO 8601 date, inclusive)Use the first day of the reporting period — e.g., first of the month for monthly reports
end_dateEnd of the reporting window (ISO 8601 date, inclusive)Use yesterday's date for "current period" reports to avoid partial-day data
granularityBreaks aggregate metrics into time series: day, week, or monthUse day for charts, month for summary tables, omit for a single aggregate number
page_id (path param)Scopes analytics to a specific UniLink pageAlways query by specific page ID for multi-page accounts to avoid mixing audiences
Revenue fieldsAll revenue values are integers in centsDivide by 100 before displaying in dashboards or sending to accounting integrations
Tip: Schedule your reporting API calls to run at 06:00 UTC each morning rather than at midnight. Analytics data for the previous day is fully aggregated by then, avoiding partial-day numbers in daily reports. Store the generated report data in your own database so historical reports remain stable even if the UniLink retention window changes.

Get the Most Out Of the Analytics Endpoint

For agency clients, build a report template that pulls from three endpoints per client: summary for the headline numbers, pages for per-page detail, and links for the top-performers widget. Automate the data pull at the end of each month, format the numbers with your agency branding, and deliver a consistent PDF or dashboard link without manual data entry. The key is fetching data with a consistent date range pattern — first to last of the previous month — so the same script runs for every client account.

Combine the analytics and orders endpoints to calculate revenue attribution by traffic source. The analytics endpoint tells you how many views and clicks each page received; the orders endpoint tells you how much revenue was generated. Dividing total revenue by unique visitors gives you revenue per visitor — a metric that most link-in-bio analytics dashboards do not surface but that is critical for evaluating the ROI of paid social campaigns driving traffic to your UniLink page.

The link click data from GET /analytics/links is invaluable for content optimization. Run this endpoint every week and compare the click-through rate of your top links over time. If a previously high-performing link drops off, investigate whether the destination URL changed, the link label lost relevance, or a new link was added above it that captures the same audience. Small label and order changes on your UniLink page can produce measurable shifts in click distribution within days.

If you are building a public-facing analytics dashboard for your users — for example, an aggregated stats page on your own site — cache the API responses in your own database rather than querying UniLink on each page load. The analytics endpoint is not designed for high-frequency real-time reads; a 15-minute to hourly cache refresh is appropriate. This also protects you from rate limit issues if your dashboard spikes in traffic.

Troubleshooting

ProblemCauseFix
Summary returns zeros for a date range with known trafficDate parameters are in the wrong format or in the futureEnsure dates are in YYYY-MM-DD format and both are in the past; confirm the range covers days when traffic actually occurred
Time series array has fewer entries than expectedSome days in the range had zero activity and are omittedFill missing dates with zero values on your side — the API omits zero-activity periods rather than returning empty rows
Revenue in analytics does not match orders totalAnalytics revenue aggregates by payment date; orders may span different billing cyclesUse the same date range on both endpoints and compare the created_at field on orders against the analytics window
GET /analytics/pages/{id} returns 404Invalid page ID or page belongs to a different accountFetch GET /pages to confirm the valid page IDs on your account, then use one of those IDs
  • Four focused sub-endpoints cover summary, page, link, and conversion analytics without a complex query language
  • Granularity parameter makes it trivial to generate time-series chart data from the same endpoint
  • Read-only endpoints mean analytics access only requires a read-scope key — safe to share with reporting tools
  • Conversion endpoint provides revenue attribution by conversion type, enabling ROI calculations without extra event tracking
  • Zero-activity days are omitted from time series responses — client-side gap-filling is required for complete charts
  • No cross-account aggregation — each account's analytics must be queried separately for agency reports
  • Revenue figures require division by 100 for display — an easy mistake when building reports quickly
How far back does analytics data go?

UniLink retains analytics data for the lifetime of your account on Pro and Business plans. Free plan accounts have a 90-day rolling window. If you need historical data beyond your plan's retention, export it periodically and store it in your own database.

Is analytics data updated in real time?

Analytics data is aggregated with a delay of approximately 5–15 minutes. For real-time visitor counts, check the live dashboard in your UniLink account. The API reflects near-real-time data suitable for reporting but not for a live visitor counter.

Can I pull analytics for all my pages in a single request?

The summary endpoint aggregates across all pages by default. For per-page breakdown in a single request, use the summary with granularity, then follow up with individual page endpoint calls for detailed metrics on each page.

What counts as a conversion in the /analytics/conversions endpoint?

A conversion is any tracked goal completion: a product purchase, a form submission, an email opt-in, or a custom event you configure in the dashboard. Each conversion type appears as a separate entry in the response with its own count and revenue total.

Does the API track traffic sources or UTM parameters?

UTM parameter tracking is available in the dashboard analytics view. The current API analytics endpoints return aggregate metrics without UTM breakdown. For UTM attribution data, use the dashboard export feature for now.

  • Four sub-endpoints cover all reporting needs: /analytics/summary, /analytics/pages/{id}, /analytics/links, and /analytics/conversions.
  • All endpoints accept start_date, end_date, and granularity (day/week/month) — consistent parameters across all analytics calls.
  • Revenue values are in cents — always divide by 100 before displaying in dashboards or reports.
  • Zero-activity days are absent from time series arrays — fill gaps with zeros on the client side for complete charts.
  • Cache API responses locally for reporting tools — the analytics endpoint is not designed for real-time high-frequency reads.

Build your first custom analytics report — generate a read-scope API key at app.unilink.us under Settings → API and start with GET /analytics/summary.

Create Your Free Link-in-Bio Page

Join thousands of creators using UniLink. 40+ blocks, analytics, e-commerce, and AI tools — all free.

Get Started Free