Question about automation with scripts


Hi there,

I like to ask you about the following idea. I got multiple choice questions in an arbitrary format and I like to code a script which uses H5P to implement these in a video. I got the time stamps for the places of the questions in a separate way. So my questions are: Is it ok for you to have a script which uses H5P and do you think this is even possible?
Thanks a lot for your answers,


otacke's picture

Hi Vulnin!

You can unzip an H5P file and inside will find the file content/content.json. It's a a plain text file in JSON format holding all the parameters for the content type, and the structure is defined by the semantics.json file of each content type. You can learn more about it in the H5P specification.

So in short: Yes, it's possible build H5P content programmatically and it's not that complicated. Sebastian Rettig did exactly that for Flash Cards. I am not sure what the real question behind "Is it ok for you to have a script which uses H5P" is, but of course you're welcome to write your own scripts if you want to.



hi otacke,  where can i get more details on how to create content programatically? do you have any developers you can recommend? we are trying to use H5P for a project

otacke's picture


You could reach out to Sebastian, for instance, who wrote the cli script that allows to create some contents programmatically.



Hi Oliver.  thanks for taking the time to reply.  I dont know how to get in touch with Sebastian.

Can you help out? 

otacke's picture

Check for contact info.

i actually think i did reach out to him


lets see if he helps out.  

In Drupal, I built a wizard for teachers that automatically creates large pieces of h5p content using various content types. 

It's laborious but not that complicated to build out the JSON array that H5P uses. Maybe there was a better way but you can basically just reverse-engineer what a finished H5P's JSON array looks like.

Try saving a video with some time-stamps, and look at the JSON. Create a form that creates that JSON and saves a new node, or whatever it's called in Wordpress etc.

Not much more I can say. It's just a manual approach that ended working really well for me. Teachers can create content with 60+ questions in around two minutes.