# Field Statistics Export + API

**URL:** <https://discuss.elastic.co/t/field-statistics-export-api/371974>\
**Category:** Kibana\
**Created:** [December 13, 2024, 10:59pm UTC](https://discuss.elastic.co/t/field-statistics-export-api/371974 "2024-12-13T22:59:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticfantastik](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@elasticfantastik](https://discuss.elastic.co/u/elasticfantastik)\
**Post date:** [December 13, 2024, 10:59pm UTC](https://discuss.elastic.co/t/field-statistics-export-api/371974/1 "2024-12-13T22:59:57Z")

</div>

Within Kibana, when clicking the "Field Statistics" for any given index, I was wondering if there's an easy way of saving the results, in particular the top-value statistics for each field. I've tried saving a webarchive, but the output is garbled. Is there a sensible way to export these field statistics?

Alternatively, is there an API way to query Field Statistics for any given index, to return results? Ideally, with a parameter "K" specifying the "Top K" values for each field?

---

<div class="post-metadata">

**Author:** ![yangmf2040](https://avatars.discourse-cdn.com/v4/letter/y/5e9695/32.png) [@yangmf2040](https://discuss.elastic.co/u/yangmf2040)\
**Post date:** [December 15, 2024, 4:47pm UTC](https://discuss.elastic.co/t/field-statistics-export-api/371974/2 "2024-12-15T16:47:06Z")

</div>

Check this out [Terms aggregation | Elasticsearch Guide [8.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-aggregations-bucket-terms-aggregation.html)
