> 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

> Stats API

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"statistics","description":"Statistics"}],"servers":[{"url":"/api"}],"paths":{"/stats":{"get":{"tags":["statistics"],"summary":"Stats API","operationId":"statsSearch","parameters":[{"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":"string"}},{"name":"displayId","in":"query","description":"An optional display Id to filter","required":false,"schema":{"type":"integer"}},{"name":"displayIds","in":"query","description":"An optional array of display Id to filter","required":false,"schema":{"type":"array","items":{"type":"integer"}}},{"name":"layoutId","in":"query","description":"An optional array of layout Id to filter","required":false,"schema":{"type":"array","items":{"type":"integer"}}},{"name":"parentCampaignId","in":"query","description":"An optional Parent Campaign ID to filter","required":false,"schema":{"type":"integer"}},{"name":"mediaId","in":"query","description":"An optional array of media Id to filter","required":false,"schema":{"type":"array","items":{"type":"integer"}}},{"name":"campaignId","in":"query","description":"An optional Campaign Id to filter","required":false,"schema":{"type":"integer"}},{"name":"returnDisplayLocalTime","in":"query","description":"true/1/On if the results should be in display local time, otherwise CMS time","required":false,"schema":{"type":"boolean"}},{"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,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatisticsData"}}}}}}}}},"components":{"schemas":{"StatisticsData":{"properties":{"type":{"description":"Class Stats","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"}},"type":"object"}}}}
```

## GET /stats/timeDisconnected

>

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"statistics","description":"Statistics"}],"servers":[{"url":"/api"}],"paths":{"/stats/timeDisconnected":{"get":{"tags":["statistics"],"operationId":"timeDisconnectedSearch","parameters":[{"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":"string"}},{"name":"displayId","in":"query","description":"An optional display Id to filter","required":false,"schema":{"type":"integer"}},{"name":"displayIds","in":"query","description":"An optional array of display Id to filter","required":false,"schema":{"type":"array","items":{"type":"integer"}}},{"name":"returnDisplayLocalTime","in":"query","description":"true/1/On if the results should be in display local time, otherwise CMS time","required":false,"schema":{"type":"boolean"}},{"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"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimeDisconnectedData"}}}}}}}}},"components":{"schemas":{"TimeDisconnectedData":{"properties":{"display":{"type":"string"},"displayId":{"type":"integer"},"duration":{"type":"integer"},"start":{"type":"string"},"end":{"type":"string"},"isFinished":{"type":"boolean"}},"type":"object"}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
