Skip to content

Statistics

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

The statistics commands show how your account is used over time: data transferred each day, storage used each day, and how often your 360 spins were viewed. Give a from and a to date, or leave them out to get the last month. Each command returns JSON that you can chart or export.

After reading this you will know

  • How to get daily transfer and storage statistics for any period
  • How to count 360 spin views
  • Which dates each command uses when you give none

Every command on this page needs a bearer token.

GEThttps://api.sirv.com/v2/stats/spins/views

Use this API method to get spins views stats over a certain period (date from/to). Date range is limited to 5 days.

Query parameters

NameTypeRequiredExampleDescription
fromdate-timeNo2020-07-01T00:00:00.000Default: 1 day ago
todate-timeNo2020-07-05T00:00:00.000Default: now
aliasstringNodemoFilter by account name (alias)

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/stats/spins/views?from=2020-07-01T00%3A00%3A00.000&to=2020-07-05T00%3A00%3A00.000', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

[
{
"@timestamp": "2020-07-04T04:54:53.632Z",
"referer": "https://sirv.com/help/articles/360-photography-photoshop/",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
"user_agent_parsed": {
"name": "Chrome",
"os": "Windows 10",
"os_name": "Windows",
"os_major": "10",
"device": "Other",
"major": "83",
"minor": "0",
"patch": "4103",
"build": "116"
},
"referer_proto": "https",
"referer_host": "sirv.com",
"referer_uripath": "/help/articles/360-photography-photoshop/",
"event": {
"origin": "/bag/bag.spin?autospin=infinite",
"type": "spin",
"name": "viewerReady",
"data": {
"rows": 1,
"columns": 16,
"viewerSize": {
"width": 354,
"height": 354
}
}
},
"geoip": {
"country_code2": "IN",
"country_name": "India",
"region_name": "10",
"timezone": "Asia/Calcutta",
"real_region_name": "Haryana"
}
}
]
GEThttps://api.sirv.com/v2/stats/storage

Use this API method to check the total amount of data stored on a given day or each day over a certain period.

Query parameters

NameTypeRequiredExampleDescription
fromdate-timeNo2020-07-01T00:00:00.000Default: 1 month ago, rounded to start of day
todate-timeNo2020-07-05T00:00:00.000Default: now, rounded to end of day

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/stats/storage?from=2020-07-01T00%3A00%3A00.000&to=2020-07-05T00%3A00%3A00.000', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"1593734400000": {
"plan": 100000000000,
"burstable": 500000000000,
"extra": 0,
"used": 49238608587,
"files": 65400,
"quotaExceededDate": null
},
"1593561600000": {
"plan": 100000000000,
"burstable": 500000000000,
"extra": 0,
"used": 49238608587,
"files": 65413,
"quotaExceededDate": null
}
}
GEThttps://api.sirv.com/v2/stats/http

Use this API method to check how much data was transferred per day during a certain period (date from/to).

The request returns aggregated HTTP log data.

Query parameters

NameTypeRequiredExampleDescription
fromdate-timeNo2020-07-01T00:00:00.000Default: 1 month ago, rounded to start of day
todate-timeNo2020-07-05T00:00:00.000Default: now, rounded to end of day

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/stats/http?from=2020-07-01T00%3A00%3A00.000&to=2020-07-05T00%3A00%3A00.000', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"1593561600000": {
"total": {
"count": 47619,
"size": 1440222650
}
},
"1593648000000": {
"total": {
"count": 75944,
"size": 2078130246
}
}
}
GEThttps://api.sirv.com/v2/stats/http/agg/traffic

Use this API method to check how much data was transferred per day during a certain period (date from/to).

The request returns aggregated HTTP log data.

Query parameters

NameTypeRequiredExampleDescription
fromdate-timeNo2020-07-01T00:00:00.000Default: 1 month ago, rounded to start of day
todate-timeNo2020-07-31T00:00:00.000Default: now, rounded to end of day

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/stats/http/agg/traffic', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Response

HTTP 200 with the answer as JSON.

Back to top