# Subcategory Name API

**URL:** https://meta.discourse.org/t/subcategory-name-api/159199
**Category:** Development
**Tags:** rest-api
**Created:** [July 29, 2020, 6:48pm UTC](https://meta.discourse.org/t/subcategory-name-api/159199 "2020-07-29T18:48:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Gaurav\_Sardana](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gaurav_sardana/32/171499_2.png) [@Gaurav\_Sardana](https://meta.discourse.org/u/Gaurav_Sardana)
#### Post date: [July 29, 2020, 6:48pm UTC](https://meta.discourse.org/t/subcategory-name-api/159199/1 "2020-07-29T18:48:42Z")

</div>

Hey,

Can anyone please help me to get subcategories name through the API. I get all the details of categories but i only get subcategory id. I want name of the subcategory.

One more thing - color and text color of a subcategory will be same as parent category ?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [July 29, 2020, 7:08pm UTC](https://meta.discourse.org/t/subcategory-name-api/159199/2 "2020-07-29T19:08:59Z")

</div>

> [@Gaurav\_Sardana](#):
>
> Can anyone please help me to get subcategories name through the API.

You can get details about all categories, including subcategories, by making a request to `/site.json`.

> [@Gaurav\_Sardana](#):
>
> One more thing - color and text color of a subcategory will be same as parent category ?

The badge color for a subcategory is set by you when you create the subcategory. For subcategories, the parent badge color is displayed along with the subcategory color. For example:

![image](https://global.discourse-cdn.com/meta/original/3X/d/6/d654439b996d9351859d539a99b192cde890b6bf.png)

or

![image](https://global.discourse-cdn.com/meta/original/3X/d/1/d106f0a38081414d0e47883d355446dc09f9b85a.png)

The first color is the parent category badge color, the second color is for the subcategory.
