# Retrieve only post ids from api

**URL:** https://meta.discourse.org/t/retrieve-only-post-ids-from-api/171052
**Category:** Development
**Tags:** rest-api
**Created:** [November 23, 2020, 6:17pm UTC](https://meta.discourse.org/t/retrieve-only-post-ids-from-api/171052 "2020-11-23T18:17:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Vloz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vloz/32/201018_2.png) [@Vloz](https://meta.discourse.org/u/Vloz)
#### Post date: [November 23, 2020, 6:17pm UTC](https://meta.discourse.org/t/retrieve-only-post-ids-from-api/171052/1 "2020-11-23T18:17:28Z")

</div>

Hello everybody,

i am trying to retrieve topic stream attribute containing every post ids, it’s pretty easy using` /t/{id}.json` but it also send back topic basic data (like firsts posts, participants, etc…).

That’s not that much expensive (50kB lol) but i was wondering if there was any way to filter the fields so i only get stream property?

Thank you.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [November 23, 2020, 10:47pm UTC](https://meta.discourse.org/t/retrieve-only-post-ids-from-api/171052/2 "2020-11-23T22:47:14Z")

</div>

For all posts IDs excluding the first post, this might be a solution: `/t/<topic_id>/post_ids.json?post_number=1`

Another solution is to create a custom SQL query with [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin.

---

<div class="post-metadata">

### Author: ![Vloz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vloz/32/201018_2.png) [@Vloz](https://meta.discourse.org/u/Vloz)
#### Post date: [November 24, 2020, 9:07am UTC](https://meta.discourse.org/t/retrieve-only-post-ids-from-api/171052/3 "2020-11-24T09:07:31Z")

</div>

> [@Arkshine](#):
>
> /t/\<topic\_id\>/post\_ids.json

Thank you! That was exactly what i was looking for! 🙂

~~EDIT: Unfortunately `/t/<topic_id>/post_ids.json` only return the 20ids. Is there any way to automatically received the twenty last ids post without knowing the topic post count?~~

EDIT2: Huh nevermind as stated by Arkshine, post\_number skip the 1rst post but ALSO break the 20ids limit.
