How to the view count of a page in confluence using Rest Api?
Asked by BAVITHRA R:

I want to get the details of how many views of my page using Rest Api, is this possible?


Answers:
author: Darryl Lee
body: Huh, it looks like there is an API for analytics, even for the **Free** plan (I just tested on my free test site): [Confluence Analytics APIs](https://developer.atlassian.com/cloud/confluence/rest/api-group-experimental/#api-wiki-rest-api-analytics-content-contentid-views-get)

These are the two endpoints available:

**GET /wiki/rest/api/analytics/content/{contentId}/views**

Get the total number of views a piece of content has.

**GET /wiki/rest/api/analytics/content/{contentId}/viewers**

Get the total number of distinct viewers a piece of content has.

-----

Because my first search found this, I'll in include this info about **paid**options:

This bug ([CONFCLOUD-67453](https://jira.atlassian.com/browse/CONFCLOUD-67453) ) notes that there is not an API for the **Analytics for Confluence Cloud** feature that is available for Premium and Enterprise Plans:

* [View analytics to see how content is performing](https://support.atlassian.com/confluence-cloud/docs/view-analytics-to-see-how-content-is-performing/)

Lastly, there are two paid add-ons for Confluence Cloud, one of which advertises that raw data can be exported via a REST API:

* [Page View Analytics for Cloud](http://Page View Analytics for Cloud)

The other add-on does not mention any API access:

* [Space Analytics](https://marketplace.atlassian.com/apps/1224547/space-analytics?hosting=cloud&tab=overview)

comments: author: Brandon Valley
body: [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)Does this work for both Confluence Cloud and Confluence Server? Are there even separate APIs for Cloud vs Server? Thanks!


author: Darryl Lee
body: Hi [@Brandon Valley](/t5/user/viewprofilepage/user-id/5100853) --

It looks like [Analytics](https://confluence.atlassian.com/doc/analytics-1044780333.html), including Page Views were added to Confluence **Data Center** (not Server) in [version 7.11.](https://confluence.atlassian.com/doc/confluence-7-11-release-notes-1035239482.html)

(This was I assume a result of [the acquisition of Good Software](https://techcrunch.com/2019/04/10/atlassian-gives-confluence-a-makeover-acquires-good-software/), who made a popular Analytics add-on for Confluence.)

This is not available in Confluence **Server.**

Furthermore, I do not see any information about this data being available in the official [Confluence (On-Prem) REST API documentation](https://docs.atlassian.com/ConfluenceServer/rest/8.0.0/).

Interestingly, I found this a bug about some undocumented Analytics APIs: [CONFSERVER-76071](https://jira.atlassian.com/browse/CONFSERVER-76071)

And this KB article includes some possible full paths you might poke around with:

* [Confluence Space Analytics renders a blank page](https://confluence.atlassian.com/confkb/confluence-space-analytics-renders-a-blank-page-1130370396.html)

I tried this on our Server instance:

<https://OURSERVER/rest/confanalytics/1.0/instance/paginated/activityBySpace>

And got:

```
{
   "error": {
      "reason": "InvalidAddonLicense",
      "message": "Add-on license is not valid."
   }
}
```

Which makes sense, since we had never purchased the [Good add-on](https://web.archive.org/web/20190621061339/https://marketplace.atlassian.com/apps/1215795/analytics-for-confluence).

I think many (frugal) users have long relied on Old Street Software's free [Page View Tracker](https://marketplace.atlassian.com/apps/1217079/page-view-tracker), which does not have an API that I am aware of, but **does** offer a CSV export and some SQL queries that you could run as well.

* [Data Access version 5.x](https://ossapps.atlassian.net/wiki/spaces/PVT/pages/1500872781/Data+Access+version+5.x)


author: Mattia _bitvoodoo ag_
body: Hello [@BAVITHRA R](/t5/user/viewprofilepage/user-id/4563016) and [@bjvtncg](/t5/user/viewprofilepage/user-id/2079452)

Our app [Viewtracker - Analytics for Confluence](https://marketplace.atlassian.com/apps/28637/viewtracker-analytics-for-confluence) is available for all hosting types and plans and comes with an API ([on-premise](https://bitvoodoo-apps.atlassian.net/wiki/spaces/BVVIEWTRACKER/pages/10477994935/Viewtracker+-+REST+Reporting+API) / [cloud](https://bitvoodoo-apps.atlassian.net/wiki/spaces/VTCLOUD/pages/12095356948/How+do+I+access+and+use+Viewtracker+s+public+API)).

Best regards

Mattia


Tags: atl-gruland

cloud

confluence-cloud