# Get only top level posts in topic via discourse API

**URL:** https://meta.discourse.org/t/get-only-top-level-posts-in-topic-via-discourse-api/86319
**Category:** Development
**Tags:** rest-api
**Created:** [April 27, 2018, 4:46pm UTC](https://meta.discourse.org/t/get-only-top-level-posts-in-topic-via-discourse-api/86319 "2018-04-27T16:46:18Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 17, 2022, 1:48pm UTC](https://meta.discourse.org/t/get-only-top-level-posts-in-topic-via-discourse-api/86319/8 "2022-03-17T13:48:57Z")

</div>

> [@coopaloop](#):
>
> I would like to be able to get the 20 most recent posts that are top level on a topic without having to recursively re-fetch and filter post replies until I have 20. Is there a filter for this and I have just missed it somewhere in the api?

We now have the `filter_top_level_replies=true` query parameter that will handle this for you.

Here is an example of it here on meta [https://meta.discourse.org/t/linkify-words-in-post/82193.json?filter\_top\_level\_replies=true](https://meta.discourse.org/t/linkify-words-in-post/82193.json?filter_top_level_replies=true)

---

_[View the full topic](https://meta.discourse.org/t/get-only-top-level-posts-in-topic-via-discourse-api/86319)._
