Skip to content

Get 360 spin views

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

Get 360 spin views with GET /v2/stats/spins/views. Date range is limited to 5 days. Each call needs a bearer token and counts towards your hourly API limit. Below are the parameters, sample code in 9 languages and a sample answer.

After reading this you will know

  • How to get 360 spin views
  • Which parameters it takes
  • Sample code in 9 languages and a sample answer

This command needs a bearer token and counts towards your hourly limit.

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"
}
}
]
Back to top