# ייבוא CSV ל-Discourse

**URL:** <https://meta.discourse.org/t/import-csv-into-discourse/186346>\
**Category:** Marketplace\
**Created:** [10 באפריל,‏ 2021,‏ 8:15pm UTC](https://meta.discourse.org/t/import-csv-into-discourse/186346 "2021-04-10T20:15:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)\
**Post date:** [11 באפריל,‏ 2021,‏ 4:32pm UTC](https://meta.discourse.org/t/import-csv-into-discourse/186346/2 "2021-04-11T16:32:14Z")

</div>

I think you can use Discourse API for this.

I did the same for that about 20K topic, can be done in hour.

I was using JAVA Test to make API call, the most important code as below:

```plaintext
        CloseableHttpClient client = HttpClients.createDefault();

        HttpPost httpPost = new HttpPost("https://www.ossez.com/posts.json");
        httpPost.setHeader(HttpHeaders.CONTENT_TYPE, "application/json; charset=UTF-8");
        httpPost.setHeader("Api-Key", "XXXXXX");
        httpPost.setHeader("Api-Username", "XXXXXX");

        TopicRequest topicRequest = new TopicRequest();
        topicRequest.setTitle(bbsOssezForumPost.getSubject());
        topicRequest.setRaw(postCtx);
        topicRequest.setCreated_at(new DateTime(bbsOssezForumPost.getDateline() * 1000L).toString() );
        topicRequest.setCategory(30);

        StringEntity postingString = new StringEntity(new Gson().toJson(topicRequest), StandardCharsets.UTF_8);

        httpPost.setEntity(postingString);

```

---

_[View the full topic](https://meta.discourse.org/t/import-csv-into-discourse/186346)._
