# API fetch most recent posts for a topic

**URL:** <https://meta.discourse.org/t/api-fetch-most-recent-posts-for-a-topic/72421>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [19 أكتوبر 2017، 4:05م UTC](https://meta.discourse.org/t/api-fetch-most-recent-posts-for-a-topic/72421 "2017-10-19T16:05:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [19 أكتوبر 2017، 8:55م UTC](https://meta.discourse.org/t/api-fetch-most-recent-posts-for-a-topic/72421/3 "2017-10-19T20:55:31Z")

</div>

If you want the latest posts, you can use `http://<server>/t/-/<topic-id>/last.json`

In the response, you’ll get the last 20 posts in `post_stream > posts` and the list of all the post ids in `post_stream > stream`.

That should be enough to do the pagination 😉

---

_[View the full topic](https://meta.discourse.org/t/api-fetch-most-recent-posts-for-a-topic/72421)._
