# Building Json response from \_cat/indices

**URL:** <https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251>\
**Category:** Elasticsearch\
**Created:** [April 24, 2016, 8:02am UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251 "2016-04-24T08:02:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [April 24, 2016, 8:02am UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251/1 "2016-04-24T08:02:54Z")

</div>

Hi Team, I am trying to call \_cat/indices api from AngularJs and i am getting json response where each key of json contains 1 alphabet of the record like below :

like for record from \_cat/indices like : yellow open .kibana

I am getting json response like below :

"0":"y","1":"e","2":"l","3":"l","4":"o","5":"w","6":" ","7":"o","8":"p","9":"e","10":"n","11":" ","12":".","13":"k","14":"i","15":"b","16":"a","17":"n","18":"a","

Please suggest how can i get the response json per record.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 24, 2016, 8:24am UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251/2 "2016-04-24T08:24:05Z")

</div>

Cat API does not send back Json content but text.  
May be use cluster state API instead?

---

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [April 24, 2016, 8:25am UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251/3 "2016-04-24T08:25:59Z")

</div>

My requirement is to get list of indices and to know which index is yellow or red . Will cluster state api provide those details also ?

---

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [April 24, 2016, 5:53pm UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251/4 "2016-04-24T17:53:36Z")

</div>

@dadoonet thanks for sharing the cluster state api, i would be able to use that api . Now i need to get the shard details also like which shard is created on which node .Now \_cat/shard api also gives text . Which api i can use to get those details in json format.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 25, 2016, 8:45pm UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251/5 "2016-04-25T20:45:33Z")

</div>

Then use it. It should give what you are looking for. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html)

---

<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, 10:56pm UTC](https://discuss.elastic.co/t/building-json-response-from--cat-indices/48251/6 "2017-07-05T22:56:25Z")

</div>


