example here: https://jsfiddle.net/gh/gist/library/pure/03b4395edb4fdc76407c6ab83edcfbe8
To pre-fill a Pen with code and options you choose, you can POST to https://codepen.io/pen/define/
with data
, where the value
of data
is JSON containing all the bits you want pre-filled. Here is a simple example:
<form action="https://codepen.io/pen/define" method="POST" target="_blank">
<input type="hidden" name="data" value='{"title": "New Pen!", "html": "<div>Hello, World!</div>"}'>
<input type="submit" value="Create New Pen with Prefilled Data">
</form>
Checkout here all the JSON options.