The HW Blog

Want to be updated? @opencoconut | Feed

Introducing a Java library

November 22, 2013 Features

Today, we are happy to announce the release of a Java library to integrate Coconut in your Java application in a snap.

We published the artifact on maven central so it's very straightforward to install and use it. Simply edit the pom.xml file and add the following:


Now run mvn clean install in your favorite terminal. That's it, everything is installed and you are ready to go.

As always, the client is very simple and follows the same rules than other libraries we provide.

import com.coconut.api.CoconutClient;
import com.coconut.api.CoconutException;
import com.coconut.api.CoconutObject;
import com.coconut.api.CoconutParameters;

public class App {

        public static void main(String[] args) throws CoconutException {
                CoconutClient hw = new CoconutClient("k-apikey");
                CoconutObject account = hw.account();
                System.out.println("account: " + account.get("login"));

                // Transferring a video
                CoconutParameters params = new CoconutParameters();
                params.put("url", "");
                params.put("title", "abc1234");
                params.put("ping_url", "");

                CoconutObject download = hw.create("download", params);

                // Creating a job
                params = new CoconutParameters();
                params.put("video_id", "ID");
                params.put("format_id", "ios_720p");
                params.put("ping_url", "");
                params.put("output_url", "s3://accesskey:secretkey@bucket/video/abc2134.mp4");

                CoconutObject job = hw.create("job", params);

                // Creating a Robot Job
                CoconutObject robotJob = hw.createRobotJob("path/to/coconut.ini");

                // Generating thumbnails
                params = new CoconutParameters();
                params.put("video_id", "ID");
                params.put("number", "6");
                params.put("filename", "abc1234_#num#");
                params.put("ping_url", "");
                params.put("output_url", "s3://accesskey:secretkey@bucket/thumbnails");

                hw.create("preview/thumbnails", params);


You can improve the library by forking it on Github.

Any Comment? Contact us via our contact page