# Api to fetch topic by page

**URL:** <https://meta.discourse.org/t/api-to-fetch-topic-by-page/63342>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [May 25, 2017, 8:51am UTC](https://meta.discourse.org/t/api-to-fetch-topic-by-page/63342 "2017-05-25T08:51:41Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [May 25, 2017, 4:21pm UTC](https://meta.discourse.org/t/api-to-fetch-topic-by-page/63342/3 "2017-05-25T16:21:27Z")

</div>

I wrote a [little script](https://github.com/pfaffman/discourse-downloader) that you can pass a category or a topic and it’ll download all of the posts. It was a little finicky getting all of the posts, as it seemed that the payload (sometimes?) includes posts before the first on requested.

> [@blake](#):
>
> This would be a good feature to add to the discourse\_api ruby gem rather than making raw api calls. There is no “Next Page” api call.

Sounds like a good idea. It might need to be limited to admins or something to protect from DDS attacks?

---

_[View the full topic](https://meta.discourse.org/t/api-to-fetch-topic-by-page/63342)._
