---
title: "Get print activity over time: print count, print time, material and cost per period, a calendar of print days, streaks, and when prints start."
method: GET
path: "/api/Analytics/activity"
tags: ["Analytics"]
---

# Get print activity over time: print count, print time, material and cost per period, a calendar of print days, streaks, and when prints start.

`GET /api/Analytics/activity`

## Request

- Base URL: `https://api.3dprintlog.com`
- URL: `https://api.3dprintlog.com/api/Analytics/activity`
- Auth: one of:
  - OAuth 2 (authorization code, authorization URL `https://3dprintlog.auth0.com/authorize`, token URL `https://3dprintlog.auth0.com/oauth/token`)
  - API key in header `X-Api-Key`
  - API key in query parameter `api_key`

Covers the authenticated user's own prints only. Every analytics endpoint takes the same
filter: a half-open `fromDate`/`toDate` range (omit both for all time), an IANA
`timeZone` for bucketing (default UTC), optional `printerIds`,
`filamentIds`, `projectIds` and `statuses`, a `granularity`
(Auto, Day, Week or Month) and `comparePrevious` to add the preceding window of the
same length. Ids the caller does not own match nothing.

## Query parameters

- `FromDate` string, date-time
- `ToDate` string, date-time
- `TimeZone` string
- `PrinterIds` integer[]
- `FilamentIds` string[]
- `ProjectIds` string[]
- `Statuses` PrintLogApiModelsPrintPrintStatus[]
- `Granularity` 0 | 1 | 2 | 3: Sent as an integer: `0` = Auto, `1` = Day, `2` = Week, `3` = Month.
- `ComparePrevious` boolean
- `HasRange` boolean

## Response `200`

The activity series and calendar for the filtered window.

- PrintLogApiModelsDTOsAnalyticsActivityResponse: The Activity tab payload. CalendarFrom/CalendarTo carry the window the calendar actually covers, which may be narrower than the filter's, so the UI never has to infer it.
  - `from` string, date-time, nullable
  - `to` string, date-time, nullable
  - `timeZone` string, nullable
  - `granularity` string, nullable
  - `currency` string, nullable
  - `series` PrintLogApiModelsDTOsAnalyticsActivitySeriesBucket[], nullable
    - `index` integer
    - `localStart` string, date
    - `count` integer
    - `durationSeconds` integer
    - `materialMg` integer
    - `cost` number, double, nullable
  - `calendar` PrintLogApiModelsDTOsAnalyticsCalendarDay[], nullable
    - `date` string, date
    - `count` integer
  - `calendarFrom` string, date, nullable
  - `calendarTo` string, date, nullable
  - `streaks` PrintLogApiServicesAnalyticsStreakSummary
    - `currentDays` integer
    - `longestDays` integer
    - `longestStart` string, date, nullable
    - `longestEnd` string, date, nullable
    - `busiestDate` string, date, nullable
    - `busiestDateCount` integer
    - `busiestWeekday` integer, nullable
    - `busiestWeekdayCount` integer
  - `durationHistogram` PrintLogApiServicesAnalyticsHistogramBucket[], nullable
    - `label` string, nullable
    - `lowerSeconds` integer
    - `upperSeconds` integer, nullable
    - `count` integer
  - `startTimeMatrix` PrintLogApiServicesAnalyticsMatrixCell[], nullable
    - `weekday` integer
    - `hour` integer
    - `count` integer
  - `coverage` PrintLogApiModelsDTOsAnalyticsCoverage: Population is named explicitly ("prints", "spools", "printers") because a count of excluded spools is not a count of excluded prints.
    - `population` string, nullable
    - `counted` integer
    - `total` integer
    - `undatedCount` integer
    - `exclusions` PrintLogApiModelsDTOsAnalyticsCoverageExclusion[], nullable
      - `reason` string, nullable
      - `count` integer

## Other responses

- `400`: The filter is invalid, for example a one-sided or reversed date range.
- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/3dprintlog/apis/3d-print-log-api.md) · [All operations](https://skmtc.dev/3dprintlog/apis/3d-print-log-api/llms.txt) · [OpenAPI document](https://skmtc.dev/3dprintlog/apis/3d-print-log-api/revisions/dfc3a4df4e38?raw)
