# Get all categories via API including subcategories

**URL:** <https://meta.discourse.org/t/get-all-categories-via-api-including-subcategories/154683>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [June 12, 2020, 5:40pm UTC](https://meta.discourse.org/t/get-all-categories-via-api-including-subcategories/154683 "2020-06-12T17:40:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gar1t](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gar1t/32/380142_2.png) [@gar1t](https://meta.discourse.org/u/gar1t)\
**Post date:** [June 12, 2020, 5:40pm UTC](https://meta.discourse.org/t/get-all-categories-via-api-including-subcategories/154683/1 "2020-06-12T17:40:04Z")

</div>

The `/categories.json` API call returns only top-level categories, at least on my server. I can read subcategories using `/c/<id>.json` but I don’t know how to discover those IDs.

---

_[View the full topic](https://meta.discourse.org/t/get-all-categories-via-api-including-subcategories/154683)._
