Get only top level posts in topic via discourse 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