# API Endpoint for Latest Topics in Public Categories

**URL:** https://meta.discourse.org/t/api-endpoint-for-latest-topics-in-public-categories/118305
**Category:** Support
**Created:** [May 21, 2019, 2:26pm UTC](https://meta.discourse.org/t/api-endpoint-for-latest-topics-in-public-categories/118305 "2019-05-21T14:26:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Alfarhan\_Zahedi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alfarhan_zahedi/32/141591_2.png) [@Alfarhan\_Zahedi](https://meta.discourse.org/u/Alfarhan_Zahedi)
#### Post date: [May 21, 2019, 2:26pm UTC](https://meta.discourse.org/t/api-endpoint-for-latest-topics-in-public-categories/118305/1 "2019-05-21T14:26:29Z")

</div>

Hi.  
I need to fetch the latest topics in public categories from my forum via an API call and embed them in my parent website.

I have implemented a basic solution using `/latest` endpoint.  
I was successful in only fetching the latest topics from public categories via the following procedure -

1. Fetch all the categories using the `/categories` endpoint.
2. Filter out the private categories via the `read_restricted` field.
3. Call the endpoint - `http://127.0.0.1:9292/latest?exclude_category_ids%5B%5D=<private_category_id_1>&exclude_category_ids%5B%5D=<private_category_id_1>&exclude_category_ids%5B%5D=<private_category_id_3> ......`

As you can see, the length of the URL will go on increasing with the number of private categories.

Is there any better solution apart from this (and exposing a custom end-point via a plugin) ?

Note - I do not want to use “suppress from latest” feature. I want it under the latest tab in the forum but not in the API call response.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 2, 2019, 9:58pm UTC](https://meta.discourse.org/t/api-endpoint-for-latest-topics-in-public-categories/118305/2 "2019-06-02T21:58:15Z")

</div>

If you do the API calls with a user that doesn’t have the right to see those categories, then they won’t be returned in the responses 😉

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 29, 2022, 5:55pm UTC](https://meta.discourse.org/t/api-endpoint-for-latest-topics-in-public-categories/118305/3 "2022-10-29T17:55:38Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 29, 2022, 6:00pm UTC](https://meta.discourse.org/t/api-endpoint-for-latest-topics-in-public-categories/118305/4 "2022-10-29T18:00:25Z")

</div>


