SG Ground Truth

POST /entity/<type>/_summarize

post_entity_type_summarize

Counts without paging rows. One grouping returns a field's distinct values and their counts at ~300ms, so rank a shortlist with it and never scan every field.

API

Params

part value
Content-Type the same vendor types _search requires
filters same shape as _search
summary_fields [{"field": "id", "type": "count"}]
grouping [{"field": ..., "type": "exact", "direction": "asc"}]. Optional

Sample requests

Grouped, which is the call worth making:

ARR = {"Content-Type": "application/vnd+shotgun.api3_array+json"}
r = c.post("/entity/versions/_summarize", headers=ARR,
           json={"filters": [["project", "is", {"type": "Project", "id": 70}]],
                 "summary_fields": [{"field": "id", "type": "count"}],
                 "grouping": [{"field": "sg_status_list", "type": "exact", "direction": "asc"}]})
{
  "data": {
    "summaries": { "id": 100 },
    "groups": [
      { "group_name": "na", "group_value": "na", "summaries": { "id": 28 } }
    ]
  }
}

Ungrouped, where the whole body is 45 bytes:

r = c.post("/entity/versions/_summarize", headers=ARR,
           json={"filters": [["project", "is", {"type": "Project", "id": 70}]],
                 "summary_fields": [{"field": "id", "type": "count"}]})
{ "summaries": { "id": 100 }, "groups": [] }

Response codes

status when
200 including for a field that cannot be summarized, where the body is near-empty

Edge cases

  • Summarizing an unsummarizable field, image, answers 200 with a 37-byte body and no summary. It does not 400. Test that the key you asked for is in summaries before reading it.
  • group_name is the rendered label and group_value the raw one. For a timecode field the rendered form is HH:MM:SS:FF, which is how the frame rate is recovered when no field exposes it.
  • One call per field at about 300ms. Over 71 fields that is 21 seconds. Rank a shortlist by fill rate first and summarize only the candidates.

Every entry on this site is the output of a probe in probes/. The corpus is generated by running those probes against a live Flow Production Tracking site, not written from memory.

Not affiliated with or endorsed by Autodesk. Flow Production Tracking is their product; this is an independent record of how its REST API answers.