# איך לפרסם בכמות

**URL:** https://meta.discourse.org/t/how-to-batch-post/281909
**Category:** Development
**Tags:** rest-api
**Created:** [11 באוקטובר,‏ 2023,‏ 5:12pm UTC](https://meta.discourse.org/t/how-to-batch-post/281909 "2023-10-11T17:12:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_王](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alex_%E7%8E%8B/32/318340_2.png) [@Alex\_王](https://meta.discourse.org/u/Alex_%E7%8E%8B)
#### Post date: [11 באוקטובר,‏ 2023,‏ 5:12pm UTC](https://meta.discourse.org/t/how-to-batch-post/281909/1 "2023-10-11T17:12:24Z")

</div>

I have some posts that include the TITLE as well as the body. I want to write a script to post this data in bulk on my discourse. Which api of Discourse should I call?

By the way, I noticed that there are some columns in the post database that are different from raw text, such as “search” (which is supposed to be used as a query index), so directly inserting the post content into the database shouldn’t work.

Thanks!!

---

<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: [12 באוקטובר,‏ 2023,‏ 9:35am UTC](https://meta.discourse.org/t/how-to-batch-post/281909/2 "2023-10-12T09:35:46Z")

</div>

Hi 👋

If you want to create new topics, I’d use [https://docs.discourse.org/#tag/Topics/operation/createTopicPostPM](https://docs.discourse.org/#tag/Topics/operation/createTopicPostPM), and set a short time limit between each request to prevent reaching the rate limit.

I think you could also use a rails script and use [discourse/lib/topic\_creator.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/lib/topic_creator.rb). You can have a look at the importer scripts to see how it’s used:

> **[discourse/script/import\_scripts at main · discourse/discourse](https://github.com/discourse/discourse/tree/main/script/import_scripts)**
>
> main/script/import\_scripts

If you don’t have tons of topics, I think a quick script using the API would be the easiest way.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [14 באוקטובר,‏ 2023,‏ 10:52pm UTC](https://meta.discourse.org/t/how-to-batch-post/281909/3 "2023-10-14T22:52:02Z")

</div>

The best documentation for the API is usually [Reverse engineer the Discourse API](https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576).

If you want to create hundreds of posts I recommend using/writing an import script.

---

<div class="post-metadata">

### Author: ![Alex\_王](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alex_%E7%8E%8B/32/318340_2.png) [@Alex\_王](https://meta.discourse.org/u/Alex_%E7%8E%8B)
#### Post date: [14 באוקטובר,‏ 2023,‏ 11:37pm UTC](https://meta.discourse.org/t/how-to-batch-post/281909/4 "2023-10-14T23:37:50Z")

</div>

Thanks everyone I use the api key and a python script solve it!!
