Skip to content

Analytics API

API endpoints for accessing analytics data

Access analytics data for your links and profiles.

Date Ranges

The stats endpoints take an optional start and end. Both accept any ISO 8601 date, for example 2024-01-31 or 2024-01-31T23:59:59Z. A missing or invalid value falls back to the default.

A date without a time means midnight UTC at the start of that day. To include all of January 31, use end=2024-02-01 or end=2024-01-31T23:59:59Z.

Get click analytics for a specific link.

GET /v1/links/:id/stats

Query Parameters

ParameterTypeDefaultDescription
startstring30 days agoStart date (ISO 8601)
endstringnowEnd date (ISO 8601)

Example Request

curl -X GET "https://linked.is/api/v1/links/42/stats?start=2024-01-01&end=2024-02-01" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
<script setup lang="ts">
const getLinkStats = async () => {
  const response = await fetch(
    "https://linked.is/api/v1/links/42/stats?start=2024-01-01&end=2024-02-01",
    {
      headers: {
        Authorization: "Bearer YOUR_API_TOKEN",
      },
    },
  );

  const data = await response.json();
  console.log(data);
  return data;
};
</script>

<template>
  <div>
    <button @click="getLinkStats">Get Link Stats</button>
  </div>
</template>

Example Response

<script setup lang="ts">
const linkStatsResponse = {
  success: true,
  data: {
    totalClicks: 1250,
    countries: [
      { country: "United States", code: "US", clicks: 450 },
      { country: "United Kingdom", code: "GB", clicks: 220 },
      { country: "Germany", code: "DE", clicks: 180 }
    ],
    devices: [
      { device: "mobile", clicks: 680 },
      { device: "desktop", clicks: 520 },
      { device: "tablet", clicks: 50 }
    ],
    browsers: [
      { browser: "Chrome", clicks: 650 },
      { browser: "Safari", clicks: 320 },
      { browser: "Firefox", clicks: 180 }
    ],
    referrers: [
      { referrer: "twitter.com", clicks: 320 },
      { referrer: "instagram.com", clicks: 280 }
    ]
  }
};
</script>

<template>
  <pre>{{ JSON.stringify(linkStatsResponse, null, 2) }}</pre>
</template>
FieldDescription
totalClicksAll clicks in the date range
countriesTop 10 countries by clicks
devicesClicks by device type: mobile, desktop or tablet
browsersTop 10 browsers by clicks
referrersTop 10 referring domains by clicks

Lists are sorted by clicks, highest first. Clicks with an unknown country, device or browser, and clicks without a referrer (direct visits), are counted in totalClicks but not in the lists.


Get Profile Stats

Get view analytics for a bio profile.

GET /v1/profiles/:id/stats

Query Parameters

ParameterTypeDefaultDescription
startstring30 days agoStart date (ISO 8601)
endstringnowEnd date (ISO 8601)

Example Request

curl -X GET "https://linked.is/api/v1/profiles/15/stats?start=2024-01-01&end=2024-02-01" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
<script setup lang="ts">
const getProfileStats = async () => {
  const response = await fetch(
    "https://linked.is/api/v1/profiles/15/stats?start=2024-01-01&end=2024-02-01",
    {
      headers: {
        Authorization: "Bearer YOUR_API_TOKEN",
      },
    },
  );

  const data = await response.json();
  console.log(data);
  return data;
};
</script>

<template>
  <div>
    <button @click="getProfileStats">Get Profile Stats</button>
  </div>
</template>

Example Response

<script setup lang="ts">
const profileStatsResponse = {
  success: true,
  data: {
    totalViews: 5420,
    countries: [
      { country: "United States", code: "US", views: 1800 }
    ],
    devices: [
      { device: "mobile", views: 3200 },
      { device: "desktop", views: 2000 }
    ],
    browsers: [
      { browser: "Chrome", views: 2900 },
      { browser: "Safari", views: 1700 }
    ],
    referrers: [
      { referrer: "instagram.com", views: 1200 },
      { referrer: "direct", views: 950 },
      { referrer: "twitter.com", views: 800 }
    ]
  }
};
</script>

<template>
  <pre>{{ JSON.stringify(profileStatsResponse, null, 2) }}</pre>
</template>
FieldDescription
totalViewsAll profile views in the date range
countriesTop 10 countries by views
devicesViews by device type: mobile, desktop or tablet
browsersTop 10 browsers by views
referrersTop 10 referring domains by views. Views without a referrer are grouped as direct

Lists are sorted by views, highest first. Views with an unknown country, device or browser appear with null for that value.


Get Account Overview

Get aggregated all-time analytics for your personal workspace, or for a team with teamId.

GET /v1/analytics/overview

Query Parameters

ParameterTypeRequiredDescription
teamIdnumberNoGet the overview of this team. See Team Workspaces

Example Request

curl -X GET "https://linked.is/api/v1/analytics/overview" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example Response

<script setup lang="ts">
const accountOverviewResponse = {
  success: true,
  data: {
    totalLinks: 45,
    totalClicks: 12500,
    totalProfiles: 3,
    totalProfileViews: 8200,
    topLinks: [
      {
        id: 42,
        slug: "my-link",
        url: "https://example.com/my-long-url",
        clicks: 2500
      }
    ],
    topProfiles: [
      {
        id: 15,
        slug: "johndoe",
        views: 5420
      }
    ]
  }
};
</script>

<template>
  <pre>{{ JSON.stringify(accountOverviewResponse, null, 2) }}</pre>
</template>
FieldDescription
totalLinksNumber of links in the workspace
totalClicksAll-time clicks of those links
totalProfilesNumber of bio profiles in the workspace
totalProfileViewsAll-time views of those profiles
topLinksUp to 5 links with the most clicks
topProfilesUp to 5 profiles with the most views. Profiles without any views are not listed