Skip to main content
GET
/
api
/
assets
/
counts
Get asset counts
curl --request GET \
  --url https://api.example.com/api/assets/counts
{
  "data": [
    {
      "time_bucket": "2023-11-07T05:31:56Z",
      "count": 123
    }
  ],
  "has_more": true
}

Query Parameters

library_id
string | null

Library to count assets in (optional)

group_by
string
default:month

Time period to group counts by. Only month is supported; other values return 422.

Allowed value: "month"
album_id
string | null

Filter by assets in a specific album

person_id
string | null

Filter by assets associated with a specific person ID

local_datetime_after
string<date-time> | null

Only include assets with local_datetime after this value (ISO 8601). Naive values compare directly against local_datetime. Timezone-aware values: assets with a known offset are compared in UTC (local_datetime - offset); assets without an offset fall back to wall-clock comparison against local_datetime.

local_datetime_before
string<date-time> | null

Only include assets with local_datetime before this value (ISO 8601). Naive values compare directly against local_datetime. Timezone-aware values: assets with a known offset are compared in UTC (local_datetime - offset); assets without an offset fall back to wall-clock comparison against local_datetime. Use the last time_bucket from a previous response to paginate.

state
enum<string>
default:live

Which set of assets to count: live (default — excludes trashed assets), trashed (only trashed assets), or all (both live and trashed).

Available options:
live,
trashed,
all
limit
integer
default:20

Maximum number of time buckets to return (1-200)

Required range: 1 <= x <= 200

Response

Successful Response

data
TimeBucketCount · object[]
required

Time bucket and count pairs, ordered by time bucket descending

has_more
boolean
required

True if there are more time buckets. To fetch the next page, pass the last time_bucket value as local_datetime_before (exclusive — buckets starting before that value are returned).