# Python API Send posts

**URL:** <https://meta.discourse.org/t/python-api-send-posts/205161>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [October 4, 2021, 2:56pm UTC](https://meta.discourse.org/t/python-api-send-posts/205161 "2021-10-04T14:56:19Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![FunnySmile](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/funnysmile/32/229095_2.png) [@FunnySmile](https://meta.discourse.org/u/FunnySmile)\
**Post date:** [October 4, 2021, 2:56pm UTC](https://meta.discourse.org/t/python-api-send-posts/205161/1 "2021-10-04T14:56:19Z")

</div>

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](https://meta.discourse.org/t/a-new-python-api/191974).

Or get the package directly:

> pip install fluent-discourse

For more interfaces, see:

> [Discourse API Docs](https://docs.discourse.org/#operation/listPosts)

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

```plaintext
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 = client.posts.json.post(data)

```

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.

---

_[View the full topic](https://meta.discourse.org/t/python-api-send-posts/205161)._
