# Interact with discourse from Python?

**URL:** https://meta.discourse.org/t/interact-with-discourse-from-python/87543
**Category:** Development
**Created:** [May 15, 2018, 4:34pm UTC](https://meta.discourse.org/t/interact-with-discourse-from-python/87543 "2018-05-15T16:34:39Z")
**Posts on this page:** 1
**Showing post:** 26

<div class="post-metadata">

### Author: ![MaukWM](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maukwm/32/485619_2.png) [@MaukWM](https://meta.discourse.org/u/MaukWM)
#### Post date: [April 19, 2026, 11:38am UTC](https://meta.discourse.org/t/interact-with-discourse-from-python/87543/26 "2026-04-19T11:38:18Z")

</div>

A bit late to this conversation (well, the extension of it :p), but I also wanted to pull data from a discourse forum and didn’t want the hassle of setting up an API key, if you (or anyone) wants a simple wrapper to pull posts from any discourse forum you can check it our [here](https://github.com/elninotech/discourse-reader)

Released on PyPi so easy to install with pip/uv, handles rate limiting for you and is typed with Pydantic (makes for a better DX imo). Usage:

```plaintext
from discourse_reader import DiscourseClient

client = DiscourseClient("https://meta.discourse.org")

# Browse categories
for cat in client.categories():
    print(f"{cat.name}: {cat.topic_count} topics")

# Get a topic with all its posts
topic = client.topics.get(12345)
print(topic.title)
print(topic.opening_post.cooked) # the original post (HTML)
print(topic.accepted_answer) # accepted answer or None
for reply in topic.posts.replies():
    print(reply.username, reply.cooked)

```

Not as extensive as `pydiscourse`but that’s intentional since it works without an API key, it also definitely won’t offer better or faster data than the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin but I think it’s nice if you just wanna quickly pull a batch of threads of simple site statistics 🙂

---

_[View the full topic](https://meta.discourse.org/t/interact-with-discourse-from-python/87543)._
