PicMonkey's online photo editor API allows you to add best-of-breed photo editing tools to your website without lifting a finger. (You can type a few lines of code with your toes, right?) Your users will be able to unleash their inner genius, have a feeding frenzy on crazy-awesome effects, and save their final edited photo back to your servers, all while singing your praises for providing them with the photo goodness. You can access an API key here: https://www.picmonkey.com/api

Basics

The PicMonkey API is pretty easy to use: you just load a URL in a browser window (or iframe). The base URL is always https://www.picmonkey.com/service. In most cases, you can launch an API request with either a GET or a POST. You also must pass your API key in the _apikey parameter. Please contact us at api@picmonkey.com to get one.

In most use cases, you’ll want to have PicMonkey automatically load an image. The key to making this happen is the _import parameter. You can either specify a URL or a POST form field containing the image you wish to open.

PicMonkey provides two main ways to get the edited image back to your servers. We can send it directly via a POST, or we can send a temporary URL (via GET or POST) that you can use to fetch the image. The POST method is generally the most efficient. The default is the ‘direct POST’ method.

Direct POST

To receive a direct POST of the edited image, pass the following parameters to the API:_export = <the url to POST data to (make sure this is URL encoded!)>_export_agent = “server”_export_method = “POST”

After the post is complete, the browser itself will navigate to the _export url. If you’d like to go to a different URL, pass it along in the _redirect parameter.

Temporary URL

To receive a temporary URL, pass these parameters:_export = <the url to POST data to (again, make sure this is URL encoded)>_export_agent = “browser”_export_method = “POST” or “GET”

Replacing Images

You may want to ask the user if it’s OK to overwrite an image when saving. This feature is controlled via the _replace and _imageid parameters. The _replace parameter can take four possible values. The combination of those values and the user’s actions control whether or not _imageid is included as a parameter on the export request.

no: _imageid is never passed through. This is the default.

yes: _imageid is always passed through

ask: The user is asked if they would like to replace the image or save a new copy. If they say ‘replace’ _imageid is passed through, otherwise it’s not passed.

confirm: The user is asked if they would like to replace the image. If they say ‘yes’, _imageid is passed through. If they say ‘no’, they are returned to the editor.

There is no requirement that _imageid actually be the ID of anything. For example, you could always pass a constant, and simply use its existence to determine whether or not to replace the image.

Reference

_importSpecifies the image to load

_returntypeDesktop software can POST an image to the API and pass _returntype=text to receive a URL that can then be loaded in a browser.

_titlePass a title to be used when saving an image to a user's computer.

_exportURL to use for exporting an image

_export_agentWhere should the export originate from

_export_fieldName of the field to contain the exported image

_export_methodShould the export be via HTTP GET or POST?

_imageidThe 'id' of the image being edited. See above for more information.

_replaceOptionally ask the user before overwriting. See above for more information.

_out_formatThe output file format (png or jpg). jpg is the default.

_out_qualityThe output compression quality (1-10). The default is 8.

_out_maxwidthMaximum output width in pixels.

_out_maxheightMaximum output height in pixels.

_close_targetURL for a destination when the user selects "close"

_redirectURL to redirect the browser to after export.

_excludeUI elements to disable. Currently, only the value of ‘in’ is supported. If specified, the upload button will be hidden.