Title: Can Import Events using a function?
Last modified: August 30, 2016

---

# Can Import Events using a function?

 *  [Ripplestone](https://wordpress.org/support/users/ripplestone/)
 * (@ripplestone)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/can-import-events-using-a-function/)
 * I would like to use PHP code to add events to The Events Calendar (Modern Tribe).
   Is there an import function I can use?
 * Has anyone used a scraper to add events to The Events Calendar Plugin?
 * [https://wordpress.org/plugins/the-events-calendar/](https://wordpress.org/plugins/the-events-calendar/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [sydbarrett74](https://wordpress.org/support/users/sydbarrett74/)
 * (@sydbarrett74)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/can-import-events-using-a-function/#post-6394662)
 * I would be curious as well. I would love to have an API to import events programmatically
   rather than having to key in the data manually. Maybe this is something only 
   available in the Pro version. 🙁
 *  [Brook](https://wordpress.org/support/users/brook-tribe/)
 * (@brook-tribe)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/can-import-events-using-a-function/#post-6394700)
 * Howdy guys,
 * You definitely can add events using our API. It’s not super well documented as
   of yet, but our plugin runs everything through the plugin function
 * `Tribe__Events__API::createEvent()`.
 * From there you can specify args. There are tons of possible args thought few 
   are required, and this is where our documentation gets a little fuzzy. You can
   see a list of possible meta values here: [https://theeventscalendar.com/knowledgebase/wordpress-post-meta-data/](https://theeventscalendar.com/knowledgebase/wordpress-post-meta-data/)
 * You might also checkout the class which power our CSV importer as it implements
   the above API in a rather concise way. It can be found:
 * `the-events-calendar/src/io/csv/ecp-events-importer.php`
 * Personally when I am inserting batches of stuff I just try to generate a CSV 
   programatically and then import that. But, that’s just been my preference to 
   date as its usually quite easy to do.
 * I hope that knowledge helps. If you have any specific ideas on what you would
   like to see in our documentation please let us know. We are working hard to improve
   it and appreciate the feedback.
 * Cheers!
    – Brook

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Can Import Events using a function?’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Brook](https://wordpress.org/support/users/brook-tribe/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/can-import-events-using-a-function/#post-6394700)
 * Status: not resolved