This is the documentation for version 4 of Viki's official API. This API is still a work in progress, which means periodic changes are expected.
All API is accessed through the api.viki.io/v4/ endpoints.
Register your application at the Viki application
You may use your normal Viki account or create a separate
manage your applications. You will be granted a
Client ID and a
An SHA1-HMAC signature, timestamp and application id should be included with every request in order to authenticate it.
The timestamp is the current time (unix timestamp) assigned to the
t parameter. The signature is the url (including querystring) + body text (if any). Your application's secret is the hmac's key.
For example, given an application id of 9001 and a secret of
orange as well as the following GET request:
The first thing we would do is add our
(assuming that today is December 26, 12:45am)
We would then get the SHA1-HMAC value of the above. In node.js, this looks like:
crypto = require('crypto'); hmac = crypto.createHmac('sha1', 'orange'); hmac.update('/v4/movies.json?sort=views&app=9001&t=1356482778'); sig = hmac.digest('hex');
And append it to our querystring:
In the case of an invalid timestamp (if the servers are out of sync), the following error will be returned:
The command should be re-issued using the returned
As an alternative to using the
sig query parameters, you can also use the
signature headers. Use whichever you prefer, but do note that using headers plays nicer with caches (the ever-changin parameters in the URL aren't cache-friendly). Our own caching layer is timestamp and signature aware, but browsers aren't.
Most API resources are retrieved in JSON. The only exception are Subtitles which are retrieved in SRT. Use the appropriate extension (
.srt) as part of your request. Leaving out the format extension will cause an error. For example:
will return a list of movie resources in JSON format, and calling:
will return the subtitles for the specified movie in srt.
If a request to a
.json endpoint also has a
callback querystring parameter, a jsonp response will be returned.
There is a mailing list for the Viki API were you can write for support: firstname.lastname@example.org
To see the group of already asked questions please direct to our google group page.