---
title: "get_account_analytics"
description: "An account's analytics: totals, day by day, its top 10 posts (with the mixetape post id when published through mixetape) and traffic sources. Defaults to the last 28 days; the last ~3 days are incomplete. Needs the **analytics** permission. Also available as the MCP tool `get_account_analytics`."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.mixetape.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: mixetape API › analytics

`POST /api/v1/tools/get_account_analytics`

An account's analytics: totals, day by day, its top 10 posts (with the mixetape post id when published through mixetape) and traffic sources. Defaults to the last 28 days; the last ~3 days are incomplete. Needs the **analytics** permission. Also available as the MCP tool `get_account_analytics`.

## Authentication

- `apiKey`, http, header `Authorization`

## Request body

_Required._

- `get_account_analytics.accountId` (string, required) — mixetape account id (list_accounts)
- `get_account_analytics.from` (string, optional) — First day, YYYY-MM-DD
- `get_account_analytics.to` (string, optional) — Last day, YYYY-MM-DD

## Example request

```json
{
  "accountId": "string",
  "from": "string",
  "to": "string"
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://mixetape.com/api/v1/tools/get_account_analytics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "string",
  "from": "string",
  "to": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://mixetape.com/api/v1/tools/get_account_analytics';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({accountId: 'string', from: 'string', to: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://mixetape.com/api/v1/tools/get_account_analytics"

payload = {
    "accountId": "string",
    "from": "string",
    "to": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The tool's result.

#### Example

```json
{
  "result": null
}
```

- `get_account_analytics.response.200.result` (unknown, required) — What the tool returns

### 400

The request is invalid; `error` says why.

#### Example

```json
{
  "error": "string"
}
```

- `get_account_analytics.response.400.error` (string, required) — What went wrong, in plain words

### 401

No valid API key.

#### Example

```json
{
  "error": "string"
}
```

- `get_account_analytics.response.401.error` (string, required) — What went wrong, in plain words

### 403

The key lacks the permission this needs.

#### Example

```json
{
  "error": "string"
}
```

- `get_account_analytics.response.403.error` (string, required) — What went wrong, in plain words

### 404

Not found, or not yours.

#### Example

```json
{
  "error": "string"
}
```

- `get_account_analytics.response.404.error` (string, required) — What went wrong, in plain words


Source: https://docs.mixetape.com/api/analytics/get_account_analytics/index.md
