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

# Analytics API

> Read the sales funnel, revenue by source and UTM, repeat-buyer cohorts, net revenue after refunds and MRR with an API key.

Every report in [Advanced analytics](/operations/advanced-analytics) (Growth)
and [MRR reports](/operations/mrr-reports) (Pro) is a `GET` with your API key.
A `pk_test_` key reads test-mode data, a `pk_live_` key live data. Money is a
decimal amount in your account currency (`currency` in every response).

| Method | Endpoint | Plan | Operation ID |
| - | - | - | - |
| `GET` | `/analytics/preview` | every plan | `getAnalyticsPreview` |
| `GET` | `/analytics/advanced/summary` | Growth | `getAnalyticsSummary` |
| `GET` | `/analytics/advanced/funnel` | Growth | `getSalesFunnel` |
| `GET` | `/analytics/advanced/sources` | Growth | `getRevenueBySource` |
| `GET` | `/analytics/advanced/cohorts` | Growth | `getRepeatBuyerCohorts` |
| `GET` | `/analytics/advanced/net-revenue` | Growth | `getNetRevenue` |
| `GET` | `/analytics/mrr` | Pro | `getMrr` |

## Range parameters

| Parameter | Default | Notes |
| - | - | - |
| `from` | 30 days before `to` | ISO date-time. |
| `to` | now | ISO date-time; a bare date (`2026-09-30`) covers the whole day. At most 732 days after `from`. |
| `timezoneOffsetMinutes` | `0` | `new Date().getTimezoneOffset()` — days and months follow your local time. MRR days are always UTC. |

Every response carries `range.previous`: the window of the same length right
before `from`, which the comparison numbers use.

## Examples

```bash theme={"system"}
# The funnel for September, with the previous 30 days for comparison
curl "https://api.pocketsflow.com/analytics/advanced/funnel?from=2026-09-01&to=2026-09-30" \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxxxxxx"

# Net revenue by UTM campaign
curl "https://api.pocketsflow.com/analytics/advanced/sources?dimension=utm_campaign" \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxxxxxx"

# MRR for one subscription offer over the last 90 days
curl "https://api.pocketsflow.com/analytics/mrr?from=2026-07-18&subscriptionId=665f1c2a9b3e4a0012ab34cd" \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxxxxxx"
```

```json title="GET /analytics/mrr (abridged)" theme={"system"}
{
  "currency": "USD",
  "range": { "from": "2026-09-17", "to": "2026-10-16", "days": 30,
             "previous": { "from": "2026-08-18", "to": "2026-09-16" } },
  "hasTrials": true,
  "summary": {
    "mrr": 4820, "arr": 57840, "subscribers": 241,
    "newMrr": 610, "expansionMrr": 120, "contractionMrr": 40, "churnedMrr": 310,
    "netMrrMovement": 380, "logoChurnRate": 4.1, "revenueChurnRate": 7.7,
    "monthlyChurnRate": 4.1, "arpu": 20, "ltv": 487.8,
    "trials": { "started": 52, "ended": 47, "converted": 21, "conversionRate": 44.7, "trialing": 18 }
  },
  "previous": { "mrr": 4440 },
  "series": [{ "day": "2026-09-17", "mrr": 4440, "newMrr": 20, "churnedMrr": 0, "netMrr": 20 }],
  "products": [{ "subscriptionId": "665f…", "name": "Pro Club", "mrr": 3100, "subscribers": 155 }]
}
```

## Plan gating

Below the plan a report needs, it answers `403` with `code: FEATURE_LOCKED`
and `details.feature` (`advancedAnalytics` or `mrrReports`),
`details.requiredPlan` and `details.requiredPlanName`. `GET
/analytics/preview` (headline totals) works on every plan.

## MCP tools

`get_analytics_preview`, `get_analytics_summary`, `get_sales_funnel`,
`get_revenue_by_source`, `get_repeat_buyer_cohorts`, `get_net_revenue` and
`get_mrr` call these endpoints. See [MCP server](/api-reference/mcp-server).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.