# Topic API gets the wrong posts- consistently off by 5

**URL:** https://meta.discourse.org/t/topic-api-gets-the-wrong-posts-consistently-off-by-5/352972
**Category:** Support
**Tags:** rest-api
**Created:** [February 18, 2025, 8:13pm UTC](https://meta.discourse.org/t/topic-api-gets-the-wrong-posts-consistently-off-by-5/352972 "2025-02-18T20:13:46Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [February 18, 2025, 8:39pm UTC](https://meta.discourse.org/t/topic-api-gets-the-wrong-posts-consistently-off-by-5/352972/2 "2025-02-18T20:39:20Z")

</div>

> [@markschmucker](#):
>
> gets the 5th post

This endpoint promises to return information _including_ the specified post, for example:

```plaintext
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq .post_stream.posts[].post_number
33
34
35
36
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

```

> [@markschmucker](#):
>
> If that’s the case, IMHO that should be done in the UI, not the API.

As a single-page application, Discourse uses its API efficiently to minimise work. It’s not reasonable to make one API call per post; that would massively balloon the amount of back and forth between client and server.

It’s trivial to select the post you expect from the result. Same as above, getting only post 40’s cooked content:

```plaintext
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq -r '.post_stream.posts[] | select(.post_number == 40) | .cooked'
<p>Hi Tiago,</p>
<p>Can you please clarify it a little bit? Some screenshots, your actual code and where is your advert appear would be very helpful. Thank you <img src="https://emoji.discourse-cdn.com/twitter/slightly_smiling_face.png?v=12" title=":slightly_smiling_face:" class="emoji" alt=":slightly_smiling_face:" loading="lazy" width="20" height="20"></p>

```

Or, if you absolutely want to return information about only the single post you are querying, you are free to make a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query that does only that.

---

_[View the full topic](https://meta.discourse.org/t/topic-api-gets-the-wrong-posts-consistently-off-by-5/352972)._
