---
title: "Document view totals"
description: "View counts, unique readers, read depth and top referrers for a document."
canonical_url: https://docs.markdrop.in/api/analytics/document-view-totals
last_updated: 2026-10-30
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Document view totals

`GET https://api.markdrop.in/api/v1/me/documents/{slug}/analytics`

View counts, unique readers, read depth and top referrers for a document. Owner only: anyone else who can read it gets `403`.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **MCP tool:** `get_document_stats` ([tools](https://docs.markdrop.in/ai/tools))

## Path parameters

- `slug` (string, required): The document's address: the part after `markdrop.in/`.

## Query parameters

- `range` (string): The period to count: `7d`, `30d`, `90d` or `all`. One of `7d`, `30d`, `all`. One of `7d`, `30d`, `all`. Default `"30d"`.

## Responses

- `200`: OK.
- `401`: No token, or the token is revoked or mistyped.
- `422`: The request didn't validate. `detail` lists each problem, with where it is (`loc`) and why (`msg`).

## Examples

**curl**

```bash
curl https://api.markdrop.in/api/v1/me/documents/k3x9q2m/analytics \
  -H "Authorization: Bearer $MARKDROP_TOKEN"
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/me/documents/k3x9q2m/analytics", {
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
  },
});
const data = await res.json();
```

**Python**

```python
import os

import requests

r = requests.get(
    "https://api.markdrop.in/api/v1/me/documents/k3x9q2m/analytics",
    headers={"Authorization": f"Bearer {os.environ['MARKDROP_TOKEN']}"},
)
r.raise_for_status()
print(r.json())
```
