Get started with Embedly's Video API with this tutorial.

The Video API lets you build your own video service into your site by providing tools to integrate video uploading and playing. In this tutorial we'll go step by step in getting started. You can skip to the bottom to see the demo in the JSFiddle, which includes customizing the button, polling for status, and embedding the video.

The video below gives an overview of the Video API and getting started with it. For more details, you can follow the following tutorial.

Activate Video in your Embedly Dashboard

If you haven't already, sign up to create an account. Click the Video tab and follow the instructions to activate video. Under API you can find your API key. You're automatically added to the free version. Note that for the free version

Your First Upload

First find a movie, any format will work. If you don't have one at hand, you can download this short clip:, and use it for the upload examples.

First we'll upload video through the Embedly dashboard. Head to the video section and click the 'Upload' button. The selected video will be uploaded and added to your list of videos. You can manage the video, get the link, and the embed code from there.

The goal is to integrate video, so you can upload and serve directly from your site. The next step will be to programmatically upload video. Get your API key from the API section of the dashboard. The first call will be via command line. Open up your terminal and make the following call, adding your API key and the specific file path for the movie.

curl '' -F [email protected] -v

You'll see a success message in the JSON response. Navigate back to your Embedly dashboard and head to the Videos tab. You'll the video you just pushed right there. You can edit the details and see it's status.

Make a Video Upload Button

Next up we'll make an upload button for videos. The upload consists of a form and a submission.
Here you'll see the HTML for the form post and submission. Add your API key and upload a video but choosing one and clicking submit. The percentage upload is logged in the console. You can see the video uploaded in your Embedly dashboard.

While this is a great place to start, there are a few things to make it better.

  • Customize the look of the button.
  • Automatically submit after a video is selected, instead of selecting and then submitting.
  • Display the percentage upload.
  • Display the iFrame only when the video is finished processing.

The demo below makes these improvements. You can make a custom button with HTML and trigger the form buttons when your custom button is clicked.

<form action="" method="POST" enctype="multipart/form-data" name="upload_form">
  <div id="upload-button" class="button">Upload Video</div>
  <div id="upload-input">
    <input id="video_file" name="video_file" type="file">
$("#upload-button").click(function(e) {

A change event on the form triggers the form submission, no need for two clicks.

$("#video_file").change(function(e) {

The progress of the upload is displayed, and there is polling of the status endpoint to determine when the video is done processing.

//Query the status endpoint 
var call = "" + emb_key + "&video_id=" + data.video_id;

pollForFinished(call, function(){renderIframe(data);});

var checkProcessed = function(_call, cb) {
    url: _call,
    type: 'GET',
    success: function(d) {
    error: function(d) {
      console.log('error!' + JSON.stringify(d));

var pollForFinished = function(_call, cb) {
  checkProcessed(_call, function(res) {
    if (res.status == "finished") {
    else if(res.status == "cancelled" || res.status =="failed"){
           $(".video-display").html('<h1>Video</h1><p>' + res.status + '</p>');
    else {
      setTimeout(pollForFinished(_call,cb), 10000);

You can see the full demo below, and see the API documentation.