spicrawlspicrawlDocs
Partner

The partner's usage across its workspaces

Usage summed over the partner's child workspaces. `group_by=day` gives one row per UTC day; `group_by=workspace` gives one row per workspace, named by `external_user_id`, and pages it.

Requires scope: partner

GET
/v1/partner/usage

Usage summed over the partner's child workspaces. group_by=day gives one row per UTC day; group_by=workspace gives one row per workspace, named by external_user_id, and pages it. The window is from (inclusive) to to (exclusive), default the last 30 days, at most 400 days.

Authorization

bearerAuth
AuthorizationBearer <token>

Authorization: Bearer <key>. Read the key from the SPICRAWL_API_KEY environment variable; never hard-code or log it. spicrawl_test_… keys can never spend live credits. Scopes: scrape, batch, sessions (granted by default), browser and read (granted deliberately), and partner (only on a partner account's key). A missing scope is 403 ERR::AUTH::INSUFFICIENT_SCOPE naming the scope.

In: header

Query Parameters

from?string
Formatdate
to?string

Exclusive.

Formatdate
group_by?string
Default"day"

Value in

  • "day"
  • "workspace"
sort?string

Workspace grouping only. Descending, ties broken by external_user_id.

Default"credits"

Value in

  • "credits"
  • "requests"
  • "fail_rate"
  • "last_active"
limit?integer

Workspace grouping only, 1 to 200.

Range1 <= value <= 200
Default50
offset?integer

Workspace grouping only.

Range0 <= value
Default0
q?string

Workspace grouping only. A prefix of external_user_id.

Lengthlength <= 128

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/v1/partner/usage"
{  "period": {    "start": "2019-08-24",    "end": "2019-08-24",    "bounds": "string",    "days": 0  },  "group_by": "day",  "totals": {    "requests": 0,    "requests_failed": 0,    "credits_micro": 0,    "credits_wallet_micro": 0,    "credits_own_micro": 0  },  "rows": [    {}  ],  "page": {    "total": 0,    "limit": 0,    "offset": 0,    "next_offset": 0  }}