# Topic URL to include its Category

**URL:** <https://meta.discourse.org/t/topic-url-to-include-its-category/39996>\
**Category:** Product Support\
**Created:** [February 22, 2016, 6:31pm UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996 "2016-02-22T18:31:03Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)\
**Post date:** [March 7, 2025, 6:29pm UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/13 "2025-03-07T18:29:10Z")

</div>

> [@Lockie](#):
>
> when it scrapes a thread (topic) it needs to infer what category it is part of, which it appears to do via the url

What software is it? You can get the category in a few ways without changing URLs (in the HTML and JSON).

For JSON, instead of scraping this:  
`https://meta.discourse.org/t/topic-url-to-include-its-category/39996`

scrape this:  
`https://meta.discourse.org/t/topic-url-to-include-its-category/39996.json`

and look for the `category_id` field.

Another possibility is using [Data Explorer](https://meta.discourse.org/t/32566?silent=true) to extract what you need.

---

_[View the full topic](https://meta.discourse.org/t/topic-url-to-include-its-category/39996)._
