const res = await fetch("https://api.openrevenue.com/api/v1/projects/example.com/os?period=30d", {
headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})
const operatingSystems = await res.json()
curl "https://api.openrevenue.com/api/v1/projects/example.com/os?period=30d" \
-H "Authorization: Bearer openrevenue_your_key"
{
"period": "30d",
"data": [
{ "name": "Android", "visitors": 16 },
{ "name": "iOS", "visitors": 11 },
{ "name": "Windows", "visitors": 5 }
]
}
OS
Returns visitor breakdown by operating system, ranked by unique visitors.
GET
/
api
/
v1
/
projects
/
{domain}
/
os
const res = await fetch("https://api.openrevenue.com/api/v1/projects/example.com/os?period=30d", {
headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})
const operatingSystems = await res.json()
curl "https://api.openrevenue.com/api/v1/projects/example.com/os?period=30d" \
-H "Authorization: Bearer openrevenue_your_key"
{
"period": "30d",
"data": [
{ "name": "Android", "visitors": 16 },
{ "name": "iOS", "visitors": 11 },
{ "name": "Windows", "visitors": 5 }
]
}
Time period. See Periods on Account API page. Defaults to 30d.
Response
Errors
| Status | Error | Description |
|---|---|---|
401 | Invalid or missing API key | The Authorization header is missing or the Bearer token is invalid. |
404 | Project not found | No project with that domain exists for the authenticated user. |
const res = await fetch("https://api.openrevenue.com/api/v1/projects/example.com/os?period=30d", {
headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})
const operatingSystems = await res.json()
curl "https://api.openrevenue.com/api/v1/projects/example.com/os?period=30d" \
-H "Authorization: Bearer openrevenue_your_key"
{
"period": "30d",
"data": [
{ "name": "Android", "visitors": 16 },
{ "name": "iOS", "visitors": 11 },
{ "name": "Windows", "visitors": 5 }
]
}
Was this page helpful?