> For the complete documentation index, see [llms.txt](https://docs.xibosignage.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xibosignage.com/developer/integrate/openapi/statistics.md).

# Statistics

Statistics

## GET /stats

>

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"statistics","description":"Statistics"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}},"schemas":{"StatisticsData":{"properties":{"type":{"type":"string"},"display":{"type":"string"},"displayId":{"type":"integer"},"layout":{"type":"string"},"layoutId":{"type":"integer"},"media":{"type":"string"},"mediaId":{"type":"integer"},"widgetId":{"type":"integer"},"scheduleId":{"type":"integer"},"numberPlays":{"type":"integer"},"duration":{"type":"integer"},"start":{"type":"string"},"end":{"type":"string"},"statDate":{"type":"string"},"tag":{"type":"string"}}}}},"paths":{"/stats":{"get":{"tags":["statistics"],"operationId":"statsSearch","parameters":[{"schema":{"type":"string"},"name":"type","in":"query","description":"The type of stat to return. Layout|Media|Widget","required":false},{"schema":{"type":"string"},"name":"fromDt","in":"query","description":"The start date for the filter. Default = 24 hours ago","required":false},{"schema":{"type":"string"},"name":"toDt","in":"query","description":"The end date for the filter. Default = now.","required":false},{"schema":{"type":"string"},"name":"statDate","in":"query","description":"The statDate filter returns records that are greater than or equal a particular date","required":false},{"schema":{"type":"string"},"name":"statId","in":"query","description":"The statId filter returns records that are greater than a particular statId","required":false},{"schema":{"type":"integer"},"name":"displayId","in":"query","description":"An optional display Id to filter","required":false},{"schema":{"type":"array","items":{"type":"integer"}},"style":"form","explode":false,"name":"displayIds","in":"query","description":"An optional array of display Id to filter","required":false},{"schema":{"type":"array","items":{"type":"integer"}},"style":"form","explode":false,"name":"layoutId","in":"query","description":"An optional array of layout Id to filter","required":false},{"schema":{"type":"integer","items":{"type":"integer"}},"name":"parentCampaignId","in":"query","description":"An optional Parent Campaign ID to filter","required":false},{"schema":{"type":"array","items":{"type":"integer"}},"style":"form","explode":false,"name":"mediaId","in":"query","description":"An optional array of media Id to filter","required":false},{"schema":{"type":"integer"},"name":"campaignId","in":"query","description":"An optional Campaign Id to filter","required":false},{"schema":{"type":"boolean"},"name":"returnDisplayLocalTime","in":"query","description":"true/1/On if the results should be in display local time, otherwise CMS time","required":false},{"schema":{"type":"string"},"name":"returnDateFormat","in":"query","description":"A PHP formatted date format for how the dates in this call should be returned.","required":false},{"schema":{"type":"string"},"name":"embed","in":"query","description":"Should the return embed additional data, options are layoutTags,displayTags and mediaTags","required":false}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatisticsData"}}}}}}}}}}
```

## GET /stats/getExportStatsCount

> Total count of stats

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"statistics","description":"Statistics"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}}},"paths":{"/stats/getExportStatsCount":{"get":{"tags":["statistics"],"summary":"Total count of stats","operationId":"getExportStatsCount","parameters":[{"schema":{"type":"string"},"name":"fromDt","in":"query","description":"The start date for the filter. Default = 24 hours ago","required":false},{"schema":{"type":"string"},"name":"toDt","in":"query","description":"The end date for the filter. Default = now.","required":false},{"schema":{"type":"integer"},"name":"displayId","in":"query","description":"An optional display Id to filter","required":false}],"responses":{"200":{"description":"successful operation"}}}}}}
```

## GET /stats/timeDisconnected

>

```json
{"openapi":"3.1.1","info":{"title":"Xibo API","version":"4.0"},"tags":[{"name":"statistics","description":"Statistics"}],"servers":[{"url":"/api"}],"security":[{"auth":["write:all","read:all"]}],"components":{"securitySchemes":{"auth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"/api/authorize","tokenUrl":"/api/authorize/access_token","scopes":{"read:all":"read access","write:all":"write access"}}}}},"schemas":{"TimeDisconnectedData":{"properties":{"display":{"type":"string"},"displayId":{"type":"integer"},"duration":{"type":"integer"},"start":{"type":"string"},"end":{"type":"string"},"isFinished":{"type":"boolean"}}}}},"paths":{"/stats/timeDisconnected":{"get":{"tags":["statistics"],"operationId":"timeDisconnectedSearch","parameters":[{"schema":{"type":"string"},"name":"fromDt","in":"query","description":"The start date for the filter.","required":true},{"schema":{"type":"string"},"name":"toDt","in":"query","description":"The end date for the filter.","required":true},{"schema":{"type":"integer"},"name":"displayId","in":"query","description":"An optional display Id to filter","required":false},{"schema":{"type":"array","items":{"type":"integer"}},"style":"form","explode":false,"name":"displayIds","in":"query","description":"An optional array of display Id to filter","required":false},{"schema":{"type":"boolean"},"name":"returnDisplayLocalTime","in":"query","description":"true/1/On if the results should be in display local time, otherwise CMS time","required":false},{"schema":{"type":"string"},"name":"returnDateFormat","in":"query","description":"A PHP formatted date format for how the dates in this call should be returned.","required":false}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimeDisconnectedData"}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xibosignage.com/developer/integrate/openapi/statistics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
