Python API Send posts

If you need to use Python to post to your forum, I’m sure this code will definitely help.

First of all, please get the tool post, tools.

Or get the package directly:

pip install fluent-discourse

For more interfaces, see:

Discourse API Docs

Thank you very much for simplifying the amount of code in the Python request API.

from fluent_discourse import Discourse
client = Discourse(base_url="url", username="user_name",
                   api_key="user_key", raise_for_rate_limit=True)
data = {
    'title': '',
# content
    'raw': '',
# Get a post ID when you need to reply to a post
#     'topic_id': '5',
# Category ID
   'category': '5',
# tags
    'tags': ['Label 1', 'Label 2'],

latest =

You can use the API to reply or post a new topic if you only need to change what you need.
I’m sorry that there may be some mistakes in the description of this article, because English is not my mother tongue. Thank you for your understanding.


I’ll show you how to get the category ID and post ID later.

1 Like

Can you post an example :slight_smile: Thank you.

Uncaught (in promise) no-response: no-response

I’m sorry that I’ve been too busy to write any more useful Python examples

I tried it and it works. Thank you very much!

1 Like