# What is the best way to get the name of all indexes?

**URL:** <https://discuss.elastic.co/t/what-is-the-best-way-to-get-the-name-of-all-indexes/28645>\
**Category:** Elasticsearch\
**Created:** [September 3, 2015, 10:05pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-get-the-name-of-all-indexes/28645 "2015-09-03T22:05:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick99e99](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick99e99/32/609_2.png) [@patrick99e99](https://discuss.elastic.co/u/patrick99e99)\
**Post date:** [September 3, 2015, 10:05pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-get-the-name-of-all-indexes/28645/1 "2015-09-03T22:05:00Z")

</div>

I am currently using \_cat/indices and parsing the return of that.. But I wondered if there's a nicer api method that will just return an array of index names?

---

<div class="post-metadata">

**Author:** ![Joshua\_Rich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_rich/32/44953_2.png) [@Joshua\_Rich](https://discuss.elastic.co/u/Joshua_Rich)\
**Post date:** [September 3, 2015, 10:52pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-get-the-name-of-all-indexes/28645/2 "2015-09-03T22:52:54Z")

</div>

With `/_cat/indices` you can add a `format` parameter to get the results back in either YAML or JSON format:

```auto
GET _cat/indices?format=json

```

or

```auto
GET _cat/indices?format=yaml

```

A structured result like that might be easier for you to parse automatically?

---

<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:** [July 5, 2017, 11:52pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-get-the-name-of-all-indexes/28645/3 "2017-07-05T23:52:10Z")

</div>


