---
title: "GET /api/v1/stats"
method: GET
path: "/api/v1/stats"
tags: ["PublicStats"]
---

# GET /api/v1/stats

`GET /api/v1/stats`

## Request

- Base URL: `https://api.habitpocket.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.habitpocket.io/api/v1/stats`
- Auth: API key in header `X-API-KEY`

## Query parameters

- `from` string, date
- `to` string, date

## Response `200`

OK

- PublicStatsModel
  - `from` string, date
  - `to` string, date
  - `totalDone` integer
  - `totalPossible` integer
  - `overallRate` integer
  - `bestStreak` integer
  - `bestStreakHabitName` string, nullable
  - `perfectDays` integer
  - `weeklyPerfectDays` PublicWeeklyPointModel[], nullable
    - `week` string, nullable
    - `value` number, double
  - `habits` PublicHabitStatsModel[], nullable
    - `id` string, uuid
    - `name` string, nullable
    - `type` string, nullable
    - `unit` string, nullable
    - `target` number, double, nullable
    - `currentStreak` integer
    - `bestStreak` integer
    - `trackedDays` integer
    - `totalDays` integer
    - `rate` integer
    - `average` number, double, nullable
    - `dailyValues` object, nullable
    - `weeklyRates` PublicWeeklyPointModel[], nullable
      - `week` string, nullable
      - `value` number, double

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required

---

[API](https://skmtc.dev/habitpocket/apis/metricspocket-public-api.md) - [All operations](https://skmtc.dev/habitpocket/apis/metricspocket-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/habitpocket/apis/metricspocket-public-api/revisions/28a2063c7bbe?raw)
