Viewrium Docs
HTTP referenceUsage

Get usage

GET/v1/usage

Event counts per hour or day over a window (default: the last 30 days), with totals and AR session time. Reads one organization (org_id, or your only one), every one you reach (scope=all), or one product (product_id). Your organization's own traffic is left out unless include_internal=true.

group_by=product adds by_product: the window's best-performing products, ranked by 3D views then AR entries, each with its title. 400 when start is not before end.

Query Parameters

start?|

The window's start (ISO 8601). Default: 30 days before end.

end?|

The window's end (ISO 8601). Default: now.

org_id?|

The organization to read. With a key, its own organization is read and org_id may be left out. Signed in, it is required unless you belong to one organization or send scope=all.

scope?ListScope

org (the default) reads one organization. all reads every organization you can reach; it needs a signed-in session (400 with a key).

Default"org"

Value in

  • "org"
  • "all"
product_id?|

Only this product's events. Its own organization is read, so org_id may be left out.

model_id?|

Only the events of one 3D model from the previous version of the API. Cannot be combined with product_id.

event_type?|

Only events of this type. Left out, every type is counted.

granularity?Granularity

The bucket size: day (the default) or hour.

Default"day"

Value in

  • "hour"
  • "day"
include_internal?Include Internal

Also count your organization's own traffic: its members viewing its products. Default false.

Defaultfalse
group_by?|

product adds by_product: the window's 20 best-performing products, ranked by 3D views, then AR entries.

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/usage"
{  "start": "2019-08-24T14:15:22Z",  "end": "2019-08-24T14:15:22Z",  "granularity": "hour",  "buckets": [    {      "period_start": "2019-08-24T14:15:22Z",      "event_type": "generation.created",      "count": 0,      "cost_cents": 0,      "duration": {        "total_ms": 0,        "count": 0      }    }  ],  "totals": {    "property1": 0,    "property2": 0  },  "durations": {    "property1": {      "total_ms": 0,      "count": 0    },    "property2": {      "total_ms": 0,      "count": 0    }  },  "by_product": [    {      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",      "title": "string",      "totals": {        "property1": 0,        "property2": 0      }    }  ]}
{  "error": {    "code": "string",    "message": "string",    "details": null  }}