# Getting all posts in a topic

**URL:** https://meta.discourse.org/t/getting-all-posts-in-a-topic/358385
**Category:** Development
**Tags:** rest-api
**Created:** [March 21, 2025, 7:48pm UTC](https://meta.discourse.org/t/getting-all-posts-in-a-topic/358385 "2025-03-21T19:48:52Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 21, 2025, 8:26pm UTC](https://meta.discourse.org/t/getting-all-posts-in-a-topic/358385/4 "2025-03-21T20:26:09Z")

</div>

Oh, I misread your post. I thought you were looking for a way to return ALL posts from a topic at once.

Here’s a script example using the API pagination (not exactly the same query, as it returns posts from a user and each page contains 50 posts, not 20):

> [@Searching for image urls in topics](https://meta.discourse.org/t/searching-for-image-urls-in-topics/346912/9):
>
> You don’t need an API key to do searches. I’m not sure having an API key could help you resolve your issue more easily. Here’s an robot example Python script that loops my posts (1 post every 3 sec) on meta and returns those having the substring upload:// in the raw content: import requests import time def fetch\_posts(page): url = f"https://meta.discourse.org/search.json?q=%40cocoquark&page={page}" response = requests.get(url) return response.json() def fetch\_post\_content(pos…

---

_[View the full topic](https://meta.discourse.org/t/getting-all-posts-in-a-topic/358385)._
