> For the complete documentation index, see [llms.txt](https://linkie.bio/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linkie.bio/docs/api-reference/analytics.md).

# Analytics

Retrieve analytics for a Linkie profile.

Analytics endpoints are designed for reporting and dashboards. Start by choosing a `link_in_bio_id`, then apply optional filters (date range, source, device, country, and more) to narrow the dataset.

### Requirements

**Authentication**: Bearer API key

**Headers**:

* ```http
  Authorization: Bearer YOUR_API_KEY
  ```

### Shared Query Parameters

All analytics endpoints require `link_in_bio_id`. The remaining filters are optional unless otherwise noted.

| Field           | Type     | Required | Description                                                |
| --------------- | -------- | -------- | ---------------------------------------------------------- |
| `url`           | `string` | Yes      | Permalink to the original post                             |
| `thumbnail_url` | `string` | No       | Thumbnail image URL.                                       |
| `provider`      | `string` | Yes      | Social network the post originates from.                   |
| `account_name`  | `string` | Yes      | Display name of the social account that authored the post. |
| `text`          | `string` | Yes      | Post text or caption.                                      |
| `post_type`     | `string` | Yes      | Type of the post.                                          |

### Date range format

When sending `start_date` and `end_date`, use `YYYY-MM-DD` strings:

* `start_date=2026-05-01`
* `end_date=2026-05-31`

{% hint style="warning" %}
If you provide only one of `start_date` or `end_date`, you may receive unexpected results. Prefer sending both for repeatable reports.
{% endhint %}

### Best practices

* Cache analytics results when building dashboards (avoid re-fetching the same date ranges repeatedly).
* Use filters to reduce payload sizes (source, device, country).
* For card analytics, paginate with `page` and `limit` instead of requesting huge pages.

### Endpoints

#### Get traffic stats for a profile

Retrieves aggregated traffic stats for a Linkie profile.

```http
GET /api/v1/analytics/traffic-stats
```

## GET /api/v1/analytics/traffic-stats

> Get traffic stats for a profile

```json
{"openapi":"3.0.0","info":{"title":"Linkie Public API","version":"1.0"},"servers":[{"url":"https://app.linkie.bio","description":"Production"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"scheme":"bearer","bearerFormat":"api-key","type":"http"}},"schemas":{"TrafficStatsResponse":{"type":"object","required":["status","statusCode","message","data","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/TrafficStatsData"},"timestamp":{"type":"string"}}},"TrafficStatsData":{"type":"object","required":["total_visitors","unique_visitors","bounce_rate","unique_clicks","total_subscribers","start_date","end_date"],"properties":{"total_visitors":{"type":"integer"},"unique_visitors":{"type":"integer"},"bounce_rate":{"type":"number"},"unique_clicks":{"type":"integer"},"total_subscribers":{"type":"integer"},"start_date":{"type":"string"},"end_date":{"type":"string"}}},"ApiErrorResponse":{"type":"object","required":["status","statusCode","message","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"timestamp":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"paths":{"/api/v1/analytics/traffic-stats":{"get":{"operationId":"PublicAnalyticsController_getTrafficStats","summary":"Get traffic stats for a profile","parameters":[{"name":"link_in_bio_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"type":"string"}},{"name":"country","required":false,"in":"query","schema":{"type":"string"}},{"name":"device","required":false,"in":"query","schema":{"type":"string"}},{"name":"browser","required":false,"in":"query","schema":{"type":"string"}},{"name":"os","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficStatsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"tags":["Analytics"]}}}}
```

#### Get traffic graph data for a profile

Retrieves traffic graph data for a Linkie profile (for charting).

```http
GET /api/v1/analytics/traffic-graph
```

## GET /api/v1/analytics/traffic-graph

> Get traffic graph data for a profile

```json
{"openapi":"3.0.0","info":{"title":"Linkie Public API","version":"1.0"},"servers":[{"url":"https://app.linkie.bio","description":"Production"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"scheme":"bearer","bearerFormat":"api-key","type":"http"}},"schemas":{"TrafficGraphResponse":{"type":"object","required":["status","statusCode","message","data","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TrafficGraphPoint"}},"timestamp":{"type":"string"}}},"TrafficGraphPoint":{"type":"object","required":["label","visitors","clicks"],"properties":{"label":{"type":"string"},"visitors":{"type":"integer"},"clicks":{"type":"integer"}}},"ApiErrorResponse":{"type":"object","required":["status","statusCode","message","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"timestamp":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"paths":{"/api/v1/analytics/traffic-graph":{"get":{"operationId":"PublicAnalyticsController_getTrafficGraph","summary":"Get traffic graph data for a profile","parameters":[{"name":"link_in_bio_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"type":"string"}},{"name":"country","required":false,"in":"query","schema":{"type":"string"}},{"name":"device","required":false,"in":"query","schema":{"type":"string"}},{"name":"browser","required":false,"in":"query","schema":{"type":"string"}},{"name":"os","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficGraphResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"tags":["Analytics"]}}}}
```

#### Get visitor country breakdown for a profile

Retrieves a visitor country breakdown for a Linkie profile.

```http
GET /api/v1/analytics/country-stats
```

## GET /api/v1/analytics/country-stats

> Get visitor country breakdown for a profile

```json
{"openapi":"3.0.0","info":{"title":"Linkie Public API","version":"1.0"},"servers":[{"url":"https://app.linkie.bio","description":"Production"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"scheme":"bearer","bearerFormat":"api-key","type":"http"}},"schemas":{"CountryStatsResponse":{"type":"object","required":["status","statusCode","message","data","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CountryStat"}},"timestamp":{"type":"string"}}},"CountryStat":{"type":"object","required":["country","count"],"properties":{"country":{"type":"string"},"count":{"type":"integer"}}},"ApiErrorResponse":{"type":"object","required":["status","statusCode","message","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"timestamp":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"paths":{"/api/v1/analytics/country-stats":{"get":{"operationId":"PublicAnalyticsController_getCountryStats","summary":"Get visitor country breakdown for a profile","parameters":[{"name":"link_in_bio_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"type":"string"}},{"name":"country","required":false,"in":"query","schema":{"type":"string"}},{"name":"device","required":false,"in":"query","schema":{"type":"string"}},{"name":"browser","required":false,"in":"query","schema":{"type":"string"}},{"name":"os","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryStatsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"tags":["Analytics"]}}}}
```

#### Get source stats

Retrieves a traffic source breakdown for a Linkie profile.

```http
GET /api/v1/analytics/source-stats
```

## GET /api/v1/analytics/source-stats

> Get traffic source breakdown for a profile

```json
{"openapi":"3.0.0","info":{"title":"Linkie Public API","version":"1.0"},"servers":[{"url":"https://app.linkie.bio","description":"Production"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"scheme":"bearer","bearerFormat":"api-key","type":"http"}},"schemas":{"SourceStatsResponse":{"type":"object","required":["status","statusCode","message","data","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/SourceStat"}},"timestamp":{"type":"string"}}},"SourceStat":{"type":"object","required":["source","count"],"properties":{"source":{"type":"string"},"count":{"type":"integer"}}},"ApiErrorResponse":{"type":"object","required":["status","statusCode","message","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"timestamp":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"paths":{"/api/v1/analytics/source-stats":{"get":{"operationId":"PublicAnalyticsController_getSourceStats","summary":"Get traffic source breakdown for a profile","parameters":[{"name":"link_in_bio_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"type":"string"}},{"name":"country","required":false,"in":"query","schema":{"type":"string"}},{"name":"device","required":false,"in":"query","schema":{"type":"string"}},{"name":"browser","required":false,"in":"query","schema":{"type":"string"}},{"name":"os","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceStatsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"tags":["Analytics"]}}}}
```

#### Get user agent stats

Retrieves browser/device breakdown data for a Linkie profile.

```http
GET /api/v1/analytics/useragent-stats
```

## GET /api/v1/analytics/useragent-stats

> Get browser/device breakdown for a profile

```json
{"openapi":"3.0.0","info":{"title":"Linkie Public API","version":"1.0"},"servers":[{"url":"https://app.linkie.bio","description":"Production"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"scheme":"bearer","bearerFormat":"api-key","type":"http"}},"schemas":{"UserAgentStatsResponse":{"type":"object","required":["status","statusCode","message","data","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/UserAgentStatsData"},"timestamp":{"type":"string"}}},"UserAgentStatsData":{"type":"object","required":["device","browser","os"],"properties":{"device":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"browser":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}},"os":{"type":"array","items":{"$ref":"#/components/schemas/NamedCount"}}}},"NamedCount":{"type":"object","required":["name","count"],"properties":{"name":{"type":"string"},"count":{"type":"integer"}}},"ApiErrorResponse":{"type":"object","required":["status","statusCode","message","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"timestamp":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"paths":{"/api/v1/analytics/useragent-stats":{"get":{"operationId":"PublicAnalyticsController_getUserAgentStats","summary":"Get browser/device breakdown for a profile","parameters":[{"name":"link_in_bio_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"type":"string"}},{"name":"country","required":false,"in":"query","schema":{"type":"string"}},{"name":"device","required":false,"in":"query","schema":{"type":"string"}},{"name":"browser","required":false,"in":"query","schema":{"type":"string"}},{"name":"os","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAgentStatsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"tags":["Analytics"]}}}}
```

#### Get card stats

Retrieves per-card interaction stats for a Linkie profile.

```http
GET /api/v1/analytics/card-stats
```

## GET /api/v1/analytics/card-stats

> Get per-card interaction stats for a profile

```json
{"openapi":"3.0.0","info":{"title":"Linkie Public API","version":"1.0"},"servers":[{"url":"https://app.linkie.bio","description":"Production"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"scheme":"bearer","bearerFormat":"api-key","type":"http"}},"schemas":{"CardStatsResponse":{"type":"object","required":["status","statusCode","message","data","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/CardStatsPage"},"timestamp":{"type":"string"}}},"CardStatsPage":{"type":"object","required":["data","total","page","limit","totalPages"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CardStat"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"totalPages":{"type":"integer"}}},"CardStat":{"type":"object","required":["card_id","type","title","url","reach","impressions","total_clicks","unique_clicks"],"properties":{"card_id":{"type":"string"},"type":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"url":{"type":"string"},"favicon_url":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"reach":{"type":"integer"},"impressions":{"type":"integer"},"total_clicks":{"type":"integer"},"unique_clicks":{"type":"integer"}}},"ApiErrorResponse":{"type":"object","required":["status","statusCode","message","timestamp"],"properties":{"status":{"type":"boolean"},"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"timestamp":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Unauthorized. Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"paths":{"/api/v1/analytics/card-stats":{"get":{"operationId":"PublicAnalyticsController_getCardStats","summary":"Get per-card interaction stats for a profile","parameters":[{"name":"link_in_bio_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"start_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"end_date","required":false,"in":"query","schema":{"type":"string"}},{"name":"source","required":false,"in":"query","schema":{"type":"string"}},{"name":"country","required":false,"in":"query","schema":{"type":"string"}},{"name":"device","required":false,"in":"query","schema":{"type":"string"}},{"name":"browser","required":false,"in":"query","schema":{"type":"string"}},{"name":"os","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardStatsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"tags":["Analytics"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://linkie.bio/docs/api-reference/analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
