Videogram API

VIDEOGRAM CREATE API

OVERVIEW

Accepts standard form POST, gets the remotely-hosted movie via server-to-server, processes it into a videogram and sends an email when ready. Processing time varies depending on video length and server load, but is usually less than 5 minutes.

Pre-Req:

Create a free publisher account at http://www.videogram.com/company/en/signup/ and then mail API@videogram.com for the API_KEY

API CALL

http://www.videogram.com/api/videogram/

DESCRIPTION

Accepts: application/x-www-form-urlencoded; charset=utf-8 method: POST (all parameters required)

api_key: <xxx>

url:(Accepts top-page / share urls from most services like Vimeo, Dailymotion, Youtube etc. or a direct url of any streamable .mp4 file).

title: Title of the Video.

email: A message will be sent to this address when the video has been processed, the id and url of the finished videogram will be in the email.

RESPONSE

200 : Ok + detailed info in JSON format

400 : Bad Request

403 : Forbidden ( i.e. bad / missing api key )

500 : Internal Server Error 400 series responses include details in JSON format.

500 series responses contain no useful information in the response body.

EXAMPLE:

curl -d "api_key=<xxx> &url=https://www.youtube.com/watch?v=MfvPDTbnplQ&email=xxx@yahoo.com" http://www.videogram.com/api/videogram/

Result:

{
    "data": [{
        "usid": 76896,
        "meid": 0,
        "comicid": 44985,
        "uuid": "7983454d-86fa-49a5-a533-052af4c52ee1",
        "album_uuid": "6e7dc254-bac6-49d0-9094-8aca41dfe808",
        "fname": "YouTube",
        "lname": "Help",
        "ppurl": "http://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/AAAAAAAAAAA/bJCTTfihBl0/s88-c-k-no/photo.jpg",
        "ppurl_small": "http://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/AAAAAAAAAAA/bJCTTfihBl0/s88-c-k-no/photo.jpg",
        "vgtitle": "https://youtube.com/devicesupport",
        "vgurl": null,
        "vgsurl": null,
        "vgplayerurl": null,
        "vgtburl": null,
        "vgtburl_medium": null,
        "vgtburl_small": null,
        "vgtburl_sixframes": null,
        "remote_album_id": "MfvPDTbnplQ",
        "album_network": "YOUTUBE",
        "channel_unique_name": "testchannel",
        "channel_name": "Test Channel",
        "channel_picture": "https://graph.facebook.com/100003322103997/picture?type\u003dlarge",
        "entity_type": "CHANNEL",
        "duration": 0,
        "view_count": 0,
        "crat": null,
        "utime": 0,
        "comments_count": 0,
        "visibility": "PUBLIC",
        "show_player_ad": false,
        "charge_type": "FREE"
    }],
    "status_code": 200,
    "status_msg": "OK",
    "status_type": "NOTSET"
}

If you want to generate a plain link to the player page, use the vgsurl value. If you want the link to autoplay from a particular time, append ?autoplay=12345 to vgplayerurl, where the number is the desired autoplay time in milliseconds. The short url does not pass the query string. Embed urls can be made simply by vgplayerurl.replace(‘comic’,’embed’) and also support autoplay. Standard embed iframe code looks like this

<iframe 
    src="//www.videogram.com/embed/uuid" 
    width="100%" 
    style="max-width: 800px;"
    height="800"
    scrolling="no"
    allowfullscreen webkitallowfullscreen mozallowfullscreen
></iframe>

 

You must declare width and height, but you don’t have to do it inline. Heights such as 80vh work quite well, and the width in the above example allows the embed to flex with the page.


VIDEOGRAM LIST API

OVERVIEW

Accepts standard GET request, replies with JSON-encoded information.

API CALL

http://www.videogram.com/api/channel/get/videos/?api_key=<xxx>&offset=0&limit=10

DESCRIPTION

accepts: text/plain method:

GET (all parameters required)

api_key: <xxx>

offset: Start at this value if you want to do list paging. Normally 0. limit: you get this many items back.

RESPONSE

200 : Ok + detailed info in JSON format. see below for example

400 : Bad Request

403 : Forbidden ( i.e. bad / missing api key )

500 : Internal Server Error 400 series responses include details in JSON format. 500 series responses contain no useful information in the response body.

EXAMPLE:

http://www.videogram.com/api/channel/get/videos/?api_key=xxx

 LIST VIDEOGRAM OUTPUT

{
    "data": [{
        "usid": 4218,
        "meid": 0,
        "comicid": 12813,
        "uuid": "44d0c001-13f5-468d-ac23-47db8dc2fd48",
        "album_uuid": "96554b75-fef3-4a06-9647-f382239b172c",
        "fname": "Jennifer",
        "lname": "Lopez",
        "ppurl": "http://i1.ytimg.com/i/x1f1u4XlFFr0YgqF3wB4lQ/1.jpg?v\u003d4ef8e2c5",
        "ppurl_small": "http://i1.ytimg.com/i/x1f1u4XlFFr0YgqF3wB4lQ/1.jpg?v\u003d4ef8e2c5",
        "vgtitle": "Jennifer Lopez - Live It Up ft. Pitbull",
        "vgurl": "//d1tw8t3o8307lr.cloudfront.net/comic?album_uuid\u003d96554b75-fef3-4a06-9647-f382239b172c",
        "vgsurl": "http://vdogr.am/10Hbt4w",
        "vgplayerurl": "//www.videogram.com/comic/44d0c001-13f5-468d-ac23-47db8dc2fd48",
        "vgtburl": "//d1tw8t3o8307lr.cloudfront.net/comic/album/96554b75-fef3-4a06-9647-f382239b172c/thumbnail/1.jpg",
        "vgtburl_medium": "//d1tw8t3o8307lr.cloudfront.net/comic/album/96554b75-fef3-4a06-9647-f382239b172c/thumbnail/medium.jpg",
        "vgtburl_small": "//d1tw8t3o8307lr.cloudfront.net/comic/album/96554b75-fef3-4a06-9647-f382239b172c/thumbnail/small.jpg",
        "vgtburl_sixframes": "//d1tw8t3o8307lr.cloudfront.net/comic/album/96554b75-fef3-4a06-9647-f382239b172c/thumbnail/sixframes.jpg",
        "remote_album_id": "BofL1AaiTjo",
        "album_network": "YOUTUBE",
        "channel_unique_name": null,
        "channel_name": null,
        "channel_picture": null,
        "entity_type": "USER",
        "duration": 0,
        "view_count": 0,
        "crat": "May 20, 2013 4:25:08 AM",
        "utime": 1369023908000,
        "comments_count": 48,
        "visibility": "PUBLIC",
        "show_player_ad": false,
        "charge_type": "PAID"
    }],
    "status_code": 200,
    "status_msg": "OK",
    "status_type": "NOTSET"
}

 

NOTES

If you want to generate a plain link to the player page, use the vgsurl value. If you want the link to autoplay from a particular time, append ?autoplay=12345 to vgplayerurl, where the number is the desired autoplay time in milliseconds. The short url does not pass the query string. Embed urls can be made simply by vgplayerurl.replace(‘comic’,’embed’) and also support autoplay. Standard embed iframe code looks like this

<iframe 
    src="//www.videogram.com/embed/uuid"
    width="100%" 
    style="max-width:
    800px;"
    height="800"
    scrolling="no"
    allowfullscreen webkitallowfullscreen mozallowfullscreen
></iframe>

You must declare width and height, but you don’t have to do it inline. Heights such as 80vh work quite well, and the width in the above example allows the embed to flex with the page.

« »