# Fetch All Posts from a Topic Using the API

**URL:** <https://meta.discourse.org/t/fetch-all-posts-from-a-topic-using-the-api/260886>\
**Category:** Integrations\
**Tags:** rest-api, how-to\
**Created:** [April 6, 2023, 11:19pm UTC](https://meta.discourse.org/t/fetch-all-posts-from-a-topic-using-the-api/260886 "2023-04-06T23:19:50Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)\
**Post date:** [April 25, 2024, 10:51pm UTC](https://meta.discourse.org/t/fetch-all-posts-from-a-topic-using-the-api/260886/5 "2024-04-25T22:51:24Z")

</div>

Hi Simon,

Using the `?page=1` parameter with the [Get a single topic endpoint](https://docs.discourse.org/#tag/Topics/operation/getTopic) will return the first 20 posts from a topic, and each subsequent page number will return up to 20 posts.

When there are no most posts available (EX: the page is too high and not valid), you’ll get a 404 response.

If you don’t specify a page number, the code will set a page number of 1, so `?page=1` is the same as not appending an explicit page to the topic request.

If you wanted to use this method to fetch all posts from a topic, you should be able to do so, even though it is not mentioned within the [Discourse API Docs](https://docs.discourse.org/).

---

_[View the full topic](https://meta.discourse.org/t/fetch-all-posts-from-a-topic-using-the-api/260886)._
