Get asset counts
Counts assets bucketed by time period — use this to summarize a library (or a filtered slice) without paging through the full timeline. Returns one row per bucket, newest-first by default or oldest-first when order=asc, with optional filtering by album, album membership, people, rating, media type, date range, location, or trash state.
To list the actual assets within a bucket, call list_assets with the same filters and a local_datetime_after / local_datetime_before window matching the bucket. Does not filter by image content; for content-based search use search_assets.
Pagination: When has_more is true, pass the last time_bucket from data as starting_after_bucket. Repeat the same group_by, order, date bounds, and non-date filters. Count bounds, the cursor, and returned bucket starts are timezone-naive local-calendar values.
Authorizations
Gumnut API key (apikey_...) sent as a Bearer token in the Authorization header. Create and manage keys in the Gumnut app, or with the API key endpoints while signed in to it.
Query Parameters
Library to count assets in. Optional if the user has a single live (non-trashed) library; required when they have multiple.
Calendar period to use for each count bucket.
day, week, month, year Return only assets in this album — the album's album_ ID, not its name.
Filter by album membership in general, rather than by membership of one specific album. This filter is independent of album_id, but combining not_in_album with album_id is contradictory and returns 422. Defaults to all.
all, in_album, not_in_album Deprecated compatibility alias for one person_ids value. Do not combine it with person_ids.
Filter to assets containing faces belonging to ALL of these people (intersection, not union). Accepts up to 200 IDs across repeated person_ids= query params or comma-delimited values. Person IDs are carried by the entries of an asset's people field (returned with include=people).
Filter to one media class (image or video). Omit to include both images and videos.
Which media class an asset belongs to.
Every image format is image and every video format is video. An asset's
class is fixed by the file originally uploaded, so an edited photo is still
image.
image, video Return assets whose effective rating is one of these exact values. Values must be integers from 0 through 5; 5 is a favorite. 0 matches every unrated form: an explicit zero, a null or legacy out-of-range effective rating, or an asset with no metadata. Accepts repeated ratings= parameters or one comma-delimited value. Omit the parameter for no rating filter.
0 <= x <= 5Only include assets captured strictly after this local wall-clock datetime (ISO 8601; exclusive). Asset counts accept timezone-naive values only; a Z suffix or timezone offset returns 422. Repeat this bound unchanged on every pagination page.
Only include assets captured strictly before this local wall-clock datetime (ISO 8601; exclusive). Asset counts accept timezone-naive values only; a Z suffix or timezone offset returns 422. Repeat this bound unchanged on every pagination page.
Center point of a radius location filter: two comma-separated decimal-degree numbers longitude,latitude, e.g. -77.05,38.95. Supply with radius. Mutually exclusive with bbox.
Radius of the center location filter, in meters (greater than 0, at most 50,000). Supply with center. Mutually exclusive with bbox.
Bounding-box (map viewport) location filter: four comma-separated decimal-degree numbers min_longitude,min_latitude,max_longitude,max_latitude (west,south,east,north), e.g. -77.1,38.9,-77.0,39.0. A box whose min_longitude exceeds max_longitude crosses the antimeridian: it selects the band running east from min_longitude over ±180° to max_longitude, so there is no need to split it client-side. Longitude order is therefore significant — transposed corners read as a crossing viewport, not as an error. A viewport 360° or wider must be sent as the full range -180,...,180,..., which the wrapped form cannot express. Mutually exclusive with center/radius.
Cursor for time-bucket pagination. Pass the last returned time_bucket unchanged; buckets after it in the requested order are returned. Omit for the first page.
Which set of assets to count: live (default — excludes trashed assets), trashed (only trashed assets), or all (both live and trashed).
live, trashed, all Sort direction for capture-date buckets: desc returns newest buckets first; asc returns oldest buckets first.
asc, desc Maximum number of time buckets to return per page (1–200). Defaults to 20.
1 <= x <= 200Response
Successful Response
Time bucket and count pairs in the requested direction
True if there are more time buckets. To fetch the next page, pass the last time_bucket as starting_after_bucket. Keep the library scope, group_by, order, state, date bounds, and every population filter unchanged.