# How to get a category name with the ID via API

**URL:** <https://meta.discourse.org/t/how-to-get-a-category-name-with-the-id-via-api/65926>\
**Category:** Development\
**Created:** [10 juli 2017 om 08:48 UTC](https://meta.discourse.org/t/how-to-get-a-category-name-with-the-id-via-api/65926 "2017-07-10T08:48:03Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![anon89120937](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@anon89120937](https://meta.discourse.org/u/anon89120937)\
**Post date:** [10 juli 2017 om 08:48 UTC](https://meta.discourse.org/t/how-to-get-a-category-name-with-the-id-via-api/65926/1 "2017-07-10T08:48:03Z")

</div>

I use Discourse API client for PHP (by @michaeld I guess) and I can’t find how to get a category name/slug with only with an ID.

I need it to display (slug and id) of all our categories and their sub-categories.  
But when I get the categories list, the only information about sub-categories is their id.

---

_[View the full topic](https://meta.discourse.org/t/how-to-get-a-category-name-with-the-id-via-api/65926)._
