Genres API

diwadm edited this page Apr 24, 2012 · 7 revisions

Index

URI

GET http://www.viki.com/api/v2/genres.json

Example

Call

GET http://www.viki.com/api/v2/genres.json

Response

[
    {
        "id": 1,
        "name": "Action & Adventure"
    },
    {
        "id": 2,
        "name": "Anime"
    },
    {
        "id": 3,
        "name": "Biographical"
    },
    {
        "id": 4,
        "name": "Cartoon"
    },
    {
        "id": 5,
        "name": "Classic & Period"
    },
    {
        "id": 6,
        "name": "Comedy"
    },
    {
        "id": 7,
        "name": "Crime"
    },
    {
        "id": 8,
        "name": "Documentary"
    },
    {
        "id": 9,
        "name": "Drama"
    },
    {
        "id": 10,
        "name": "Entertainment"
    },
    {
        "id": 11,
        "name": "Historical"
    },
    {
        "id": 12,
        "name": "Horror & Supernatural"
    },
    {
        "id": 13,
        "name": "Indie"
    },
    {
        "id": 14,
        "name": "Lifestyle"
    },
    {
        "id": 15,
        "name": "Live Show"
    },
    {
        "id": 16,
        "name": "Live Action"
    },
    {
        "id": 17,
        "name": "Music"
    },
    {
        "id": 18,
        "name": "Romance"
    },
    {
        "id": 19,
        "name": "SciFi & Fantasy"
    },
    {
        "id": 20,
        "name": "Sports"
    },
    {
        "id": 21,
        "name": "Variety Show"
    },
    {
        "id": 22,
        "name": "Western"
    }
]

Sample Code

Here is a sample jQuery code to parse the JSON response:

$.getJSON("http://www.viki.com/api/v2/genres.json?callback=?", function(data) {
    $.each(data, function(i, item) {
      alert('Genre name is ' + item.name);
    });
    });