# Wondering about REST API difference between \_cat/count vs \_stats

**URL:** <https://discuss.elastic.co/t/wondering-about-rest-api-difference-between-cat-count-vs-stats/309272>\
**Category:** Elasticsearch\
**Created:** [July 10, 2022, 8:38pm UTC](https://discuss.elastic.co/t/wondering-about-rest-api-difference-between-cat-count-vs-stats/309272 "2022-07-10T20:38:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [July 10, 2022, 8:38pm UTC](https://discuss.elastic.co/t/wondering-about-rest-api-difference-between-cat-count-vs-stats/309272/1 "2022-07-10T20:38:32Z")

</div>

Trying to understand why it seems that indicies/\_stats doesn't return the proper numbers of docs as \_cat/count/index and kibana discover does?

eg. finding these samples from a sample index with a simple REST API CLI wrapper:

```auto
$ esapi -g _cat/count/ebopsyslog.2019
1657484984 20:29:44 2993565
$ esapi -g ebopsyslog.2019/_stats | jq ._all.primaries.docs.count
6574428
$ esapi -g ebopsyslog.2019/_stats | jq . | grep 2993565

```

Counting via Kibana Discover I also finds 2,993,264 hits from this sample index, was expecting the same counts from both API calls...

Hints appreciated!

---

<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:** [August 7, 2022, 8:38pm UTC](https://discuss.elastic.co/t/wondering-about-rest-api-difference-between-cat-count-vs-stats/309272/2 "2022-08-07T20:38:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
