# Total number of clicks of one document

**URL:** https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088
**Category:** Elastic Search
**Created:** [September 1, 2021, 5:22pm UTC](https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088 "2021-09-01T17:22:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ntruongsinh](https://avatars.discourse-cdn.com/v4/letter/n/8c91f0/32.png) [@ntruongsinh](https://discuss.elastic.co/u/ntruongsinh)
#### Post date: [September 1, 2021, 5:22pm UTC](https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088/1 "2021-09-01T17:22:06Z")

</div>

Hi everyone,  
I'm struggling with getting the total number of clicks of one document. As I see here [Analytics clicks API | Elastic App Search Documentation [7.14] | Elastic](https://www.elastic.co/guide/en/app-search/current/clicks.html#clicks-query), we only can get the total number of clicks in one query. So for example, we have one document which is SHOE-1, it's clicked 3 times in A query, 2 times in B query, so how could we get the total number of clicks which is 5 in all queries?

Thank you.

---

<div class="post-metadata">

### Author: ![Irina\_Truong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irina_truong/32/112040_2.png) [@Irina\_Truong](https://discuss.elastic.co/u/Irina_Truong)
#### Post date: [September 2, 2021, 9:41pm UTC](https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088/2 "2021-09-02T21:41:11Z")

</div>

Hi @ntruongsinh ,

if you're looking to see analytics related to a single document, you need to use the `counts` endpoint (not the `clicks`). See example in documentation here that does exactly what you want:

> **[Analytics counts API | Elastic App Search Documentation \[7.14\] | Elastic](https://www.elastic.co/guide/en/app-search/current/counts.html#counts-counts-document)**

Request would look like this:

```auto
curl -XGET "http://<ENT-SEARCH-URL>/api/as/v1/engines/national-parks-demo/analytics/counts" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <private-KEY-HERE>'\
-d '{filters: {"document_id": "12345"}}'

```

Cheers!

---

<div class="post-metadata">

### Author: ![ntruongsinh](https://avatars.discourse-cdn.com/v4/letter/n/8c91f0/32.png) [@ntruongsinh](https://discuss.elastic.co/u/ntruongsinh)
#### Post date: [September 3, 2021, 1:29am UTC](https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088/3 "2021-09-03T01:29:47Z")

</div>

Wow, thank you so much @Irina_Truong , I was not aware of this. However, one more concern @Irina_Truong , it tells us that we could only get the clicks in maximum 100 days in one call, is that right? So it means that we have to trigger other calls if we want more days.  
Thanks.

---

<div class="post-metadata">

### Author: ![Irina\_Truong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irina_truong/32/112040_2.png) [@Irina\_Truong](https://discuss.elastic.co/u/Irina_Truong)
#### Post date: [September 3, 2021, 11:48pm UTC](https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088/4 "2021-09-03T23:48:33Z")

</div>

Yes, this is true. I filed an enhancement ticket to ask for this query of yours to be supported in later versions. It feels like it might be a useful feature to have.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 4, 2022, 8:32am UTC](https://discuss.elastic.co/t/total-number-of-clicks-of-one-document/283088/5 "2022-11-04T08:32:08Z")

</div>


