<p>The <a href="https://github.com/boboldehampsink/import/" rel="nofollow">Import</a> plugin by Bob Olde Hampsink can import CSVs. JSON support is on the roadmap, but in the meantime, it’s easy enough to convert JSON to a CSV with a little bit of Javascript.</p>

<p>Just paste this into your browser’s JS console on any webpage:</p>

<pre class="lang-js prettyprint-override"><code>var data = [
    { title: "Entry Title", body: "Body content" },
    { title: "Entry Title 2", body: "More body content" },
    // etc.
];

function csvVal(val) {
    // Borrowed from http://phpjs.org/functions/addslashes/
    return '"' + ((val + '').replace(/[\\"']/g, '\\$&amp;').replace(/\u0000/g, '\\0')) + '"';
}

var csv = '';

data.forEach(function(row) {
    csv += csvVal(row.title) + ',' + csvVal(row.body) + "\n";
});

console.log(csv);
</code></pre>

<p>Save the resulting CSV as somefile.csv and then you can upload it to the Import plugin.</p>

CC BY-SA 3.0
2014-10-09T17:47:56.567Z
Thanks Brandon! I need this import to happen regularly (based on a cronjob or something along those lines) and was hoping to avoid programming all of the JSON to field mapping, etc.

I ended up writing a small plugin that converts the JSON feed to RSS and then using the craft.feeds functionality to output them on the site.
pstinnett
CC BY-SA 3.0
2014-10-08T16:56:01.360Z
2014-10-08T16:56:01.360Z
Brandon Kelly
<p>Check out the <a href="https://github.com/engram-design/FeedMe" rel="nofollow noreferrer">FeedMe</a> plugin. It's pretty similar to DataGrab and Importer.</p>

<p>From the README:</p>

<blockquote>
  <h1>Feed Me</h1>
  
  <p>Feed Me is a Craft plugin to make it easy to import entries and entry data from XML, RSS, ATOM or JSON feeds. Feeds can be setup as a task in Craft's Control Panel, or called on-demand for use in your twig templates.</p>
  
  <p>A common use-case for this plugin is to consume external feeds (news, events), but can also be used as a once-off task for importing content when migrating from other sites.</p>
  
  <p><img src="https://raw.githubusercontent.com/engram-design/FeedMe/master/screenshots/main.png" /></p>
  
  <h2>Features</h2>
  
  <ul>
  <li>Import data from XML, RSS, ATOM or JSON feeds.</li>
  <li>Feeds are saved to allow easy re-processing on-demand, or to be used in a Cron job.</li>
  <li>Map feed data to your entry fields. See Supported Fieldtypes.</li>
  <li>Duplication handling - control what happens when feeds are processed again.</li>
  <li>Uses Craft's Task service to process feeds in the background.</li>
  <li>Database backups before each feed processing.</li>
  <li>Troubleshoot feed processing issues with logs.</li>
  <li>Grab feed data directly from your twig templates.</li>
  <li>Craft 2.5 compatible.</li>
  </ul>
</blockquote>

<p><em>Disclosure: I authored this free plugin. Let me know if I can be of assistance!</em></p>

CC BY-SA 3.0
2016-12-22T23:25:50.233Z
I expanded your post to include more details about your plugin (which looks great, by the way!)
Simon East
CC BY-SA 3.0
2015-04-03T12:03:41.100Z
2016-12-23T03:58:58.383Z
2016-12-23T03:58:58.383Z
crawf
<p>I'm wondering if this plugin already exists and I'm just not finding it on Github or via Google. Essentially looking for a CraftCMS version of the ExpressionEngine plugin called "Data Grab" - <a href="http://brandnewbox.co.uk/products/details/datagrab" rel="noreferrer">http://brandnewbox.co.uk/products/details/datagrab</a></p>

<p>This plugin basically lets you define a feed and run automated imports to create entries. Hoping someone has done this in Craft or has some pointers to a preexisting plugin!</p>

<p>Thanks!</p>

<entries><import><json>
Creating entries from JSON feed - plugin?
# Creating entries from JSON feed - plugin?

(Asked by: username_0 on 2014-10-08)

I'm wondering if this plugin already exists and I'm just not finding it on Github or via Google. Essentially looking for a CraftCMS version of the ExpressionEngine plugin called "Data Grab" - <http://brandnewbox.co.uk/products/details/datagrab>

This plugin basically lets you define a feed and run automated imports to create entries. Hoping someone has done this in Craft or has some pointers to a preexisting plugin!

Thanks!

**Tags:** entries, import, json

---

## 2 answers

### Answer by username_1 on 2014-10-08. Score: 3 | Accepted answer

The Import plugin by Bob Olde Hampsink can import CSVs. JSON support is on the roadmap, but in the meantime, it’s easy enough to convert JSON to a CSV with a little bit of Javascript.
Just paste this into your browser’s JS console on any webpage:
var data = [
    { title: "Entry Title", body: "Body content" },
    { title: "Entry Title 2", body: "More body content" },
    // etc.
];

function csvVal(val) {
    // Borrowed from http://phpjs.org/functions/addslashes/
    return '"' + ((val + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0')) + '"';
}

var csv = '';

data.forEach(function(row) {
    csv += csvVal(row.title) + ',' + csvVal(row.body) + "\n";
});

console.log(csv);

Save the resulting CSV as somefile.csv and then you can upload it to the Import plugin.

> **Comments:**
> **username_0**: Thanks Brandon! I need this import to happen regularly (based on a cronjob or something along those lines) and was hoping to avoid programming all of the JSON to field mapping, etc.  I ended up writing a small plugin that converts the JSON feed to RSS and then using the craft.feeds functionality to output them on the site.  

---

### Answer by username_2 on 2015-04-03. Score: 6

Check out the [FeedMe](https://github.com/engram-design/FeedMe) plugin. It's pretty similar to DataGrab and Importer.

From the README:

> # Feed Me
>
> Feed Me is a Craft plugin to make it easy to import entries and entry data from XML, RSS, ATOM or JSON feeds. Feeds can be setup as a task in Craft's Control Panel, or called on-demand for use in your twig templates.
>
> A common use-case for this plugin is to consume external feeds (news, events), but can also be used as a once-off task for importing content when migrating from other sites.
>
> ![](https://raw.githubusercontent.com/engram-design/FeedMe/master/screenshots/main.png)
>
> ## Features
>
> * Import data from XML, RSS, ATOM or JSON feeds.
> * Feeds are saved to allow easy re-processing on-demand, or to be used in a Cron job.
> * Map feed data to your entry fields. See Supported Fieldtypes.
> * Duplication handling - control what happens when feeds are processed again.
> * Uses Craft's Task service to process feeds in the background.
> * Database backups before each feed processing.
> * Troubleshoot feed processing issues with logs.
> * Grab feed data directly from your twig templates.
> * Craft 2.5 compatible.

*Disclosure: I authored this free plugin. Let me know if I can be of assistance!*

> **Comments:**
> **username_3**: I expanded your post to include more details about your plugin (which looks great, by the way!)  

---

