# Category by id using API

**URL:** https://meta.discourse.org/t/category-by-id-using-api/118621
**Category:** Development
**Created:** [May 24, 2019, 7:02pm UTC](https://meta.discourse.org/t/category-by-id-using-api/118621 "2019-05-24T19:02:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mcki0127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcki0127/32/201965_2.png) [@mcki0127](https://meta.discourse.org/u/mcki0127)
#### Post date: [May 24, 2019, 7:02pm UTC](https://meta.discourse.org/t/category-by-id-using-api/118621/1 "2019-05-24T19:02:38Z")

</div>

Is there a way to get category by id using the api? Right now I’m using categories.json and iterating over the results. This feels like a dumb question, so sorry if it is.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 24, 2019, 7:38pm UTC](https://meta.discourse.org/t/category-by-id-using-api/118621/2 "2019-05-24T19:38:32Z")

</div>

You could try something like `https://meta.discourse.org/c/feature.json`  
and get something like `topic_list.topics[0].category_id`. Maybe?

---

<div class="post-metadata">

### Author: ![mcki0127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcki0127/32/201965_2.png) [@mcki0127](https://meta.discourse.org/u/mcki0127)
#### Post date: [May 24, 2019, 8:57pm UTC](https://meta.discourse.org/t/category-by-id-using-api/118621/3 "2019-05-24T20:57:02Z")

</div>

Thanks for your reply. That’s not quite what I’m after. I’m using the api to give group owners the ability to add, remove, rename, and choose color of child categories within a private group (but not outside the group). So I’m using categories.json to get the parent category (preferably by id) and then site.json to get the child categories.
