This endpoint allows you to get video analytics.
Some things to note:

  • Date ranges are inclusive

Collection /analytics/language

Get analytics based on language or for a language

GET /analytics/language/:organisation_id

Gets language usage data for an organisation account

item value
Access user
Full url https://api.buto.tv/v2/analytics/language/:organisation_id?date_from=2014-01-01&date_to=2014-01-02
verb GET
params string:id string:date_from string:date_to

GET /analytics/language/subtitle/:organisation_id

Gets subtitle usage data for an organisation account

item value
Access user
Full url https://api.buto.tv/v2/analytics/language/subtitle/:organisation_id?date_from=2014-01-01&date_to=2014-01-02
verb GET
params string:id string:date_from string:date_to

Collection /analytics/views

Get basic analytics
You can see and try a demo endpoint here as well as seeing all the error codes:

Apiary Demo

GET /analytics/views/:id

Get views data for all videos in an organisation for your date range

  • date_start - DEFAULT 2012-01-01, specify a start date (inclusive).
  • date_end - DEFAULT NOW(), specify an end date (inclusive) which defaults to today
  • filter - DEFAULT null, specify a JSON array of items to filter results by. Currently can only filter by video_id.

item value
Access user | system
Full url https://api.buto.tv/v2/analytics/views/{id}/?date_start={date_start}&date_end={date_end}&filter={filter}
verb GET
params string:id string:date_start string:date_end string:filter

Example usage

#get video analytics for an organisation during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/analytics/views/Bbgwg?date_start=2014-01-01&date_end=2014-01-31&filter={"video_id":["12345","56789"]}

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "organisation_id": "Bbgwg",
    "complete_views": 69000,
    "bounced_views": 9000,
    "player_loads": 900000,
    "video_plays": 90000,
    "date_start": "2014-08-05",
    "date_end": "2014-08-09"
}

GET /analytics/views/:id/per-day

Get views data for all videos in an organisation for your date range grouped by day

  • date_start - DEFAULT 2012-01-01, specify a start date (inclusive).
  • date_end - DEFAULT NOW(), specify an end date (inclusive) which defaults to today
  • filter - DEFAULT null, specify a JSON array of items to filter results by. Currently can only filter by video_id.

item value
Access user | system
Full url https://api.buto.tv/v2/analytics/views/{id}/per-day/?date_start={date_start}&date_end={date_end}&filter={filter}
verb GET
params string:id string:date_start string:date_end

Example usage

#get video analytics for an organisation during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/analytics/views/Bbgwg/per-day/?date_start=2014-01-01&date_end=2014-01-31&filter={"video_id":["12345","56789"]}

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

[
    {
        "day": "2014-08-05",
        "organisation_id": "Bbgwg",
        "complete_views": 69000,
        "bounced_views": 9000,
        "player_loads": 900000,
        "video_plays": 90000
    },
    {
        "day": "2014-08-06",
        "organisation_id": "Bbgwg",
        "complete_views": 1230,
        "bounced_views": 235,
        "player_loads": 83543,
        "video_plays": 5435
    }
]

GET /analytics/views/:id/per-video

Get views data for all videos in an organisation for your date range grouped by video id
- org_id - Your organisation_id
- date_start - DEFAULT 2012-01-01, specify a start date (inclusive).
- date_end - DEFAULT NOW(), specify an end date (inclusive) which defaults to today
- filter - DEFAULT null, specify a JSON arrays of items to filter results by. Currently can filter by video_id and (ISO language codes)[https://msdn.microsoft.com/en-us/library/ee825488%28v=cs.20%29.aspx].
- detailed - DEFAULT false, show detailed per-video analytics including percentage watched

item value
Access user | system
Full url https://api.buto.tv/v2/analytics/views/{org_id}/per-video/?date_start={date_start}&date_end={date_end}&filter={filter}
verb GET
params string:org_id string:date_start string:date_end `filter={video_id:[],language:[]}

Example usage 1 - filter by video_ids

#get video analytics for an organisation during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/analytics/views/Bbgwg/per-video/?date_start=2014-01-01&date_end=2014-01-31&filter={"video_id":["12345","56789"]}

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

[
    {
        "video_id": "12345",
        "organisation_id": "Bbgwg",
        "complete_views": 69000,
        "bounced_views": 9000,
        "player_loads": 900000,
        "video_plays": 90000,
        "date_start": "2014-08-05",
        "date_end": "2014-08-09"
    },
    {
        "video_id": "56789",
        "organisation_id": "Bbgwg",
        "complete_views": 1230,
        "bounced_views": 235,
        "player_loads": 83543,
        "video_plays": 5435,
        "date_start": "2014-08-05",
        "date_end": "2014-08-09"
    }
]

Example usage 2 - filter by languages

#get video analytics for an organisation during April 2015, filter by french and english videos only

API_KEY=my_api_key12345

#NB we're using the --data-urlencode for the json var, as json on shell prompt is painful
curl -G -u ${API_KEY}:x -v "https://api.buto.tv/v2/analytics/views/Bbgwg/per-video?date_start=2015-04-07&date_end=2015-04-07&detailed=true" --data-urlencode 'filter={'language':['fr-FR','en-GB'}'

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
        "average_percentage_viewed": 5,
        "average_viewing_time": 0.25,
        "bounced_views": 1,
        "complete_views": 0,
        "date_end": "2015-04-07",
        "date_start": "2015-04-07",
        "description": "Short video test in french",
        "language": "fr-FR",
        "max_percentage_viewed": {
            "0": 0,
            "10": 0,
            "100": 0,
            "15": 0,
            "20": 0,
            "25": 0,
            "30": 0,
            "35": 0,
            "40": 0,
            "45": 0,
            "5": 1,
            "50": 0,
            "55": 0,
            "60": 0,
            "65": 0,
            "70": 0,
            "75": 0,
            "80": 0,
            "85": 0,
            "90": 0,
            "95": 0
        },
        "organisation_id": "Bbgwg",
        "player_loads": 2,
        "title_private": "le testThreeSeconds",
        "title_public": "le testThreeSeconds.mp4 sur avec la chien",
        "video_duration": 5,
        "video_id": "X54s7",
        "video_plays": 1,
        "views_per_duration": {
            "0": 1,
            "10": 0,
            "100": 0,
            "15": 0,
            "20": 0,
            "25": 0,
            "30": 0,
            "35": 0,
            "40": 0,
            "45": 0,
            "50": 0,
            "55": 0,
            "60": 0,
            "65": 0,
            "70": 0,
            "75": 0,
            "80": 0,
            "85": 0,
            "90": 0,
            "95": 0
        }
    },
    {
        "average_percentage_viewed": 0,
        "average_viewing_time": 0,
        "bounced_views": 2,
        "complete_views": 0,
        "date_end": "2015-04-07",
        "date_start": "2015-04-07",
        "description": "How to easily clean your bike the like a pro",
        "language": "en-GB",
        "max_percentage_viewed": {
            "0": 2,
            "10": 0,
            "100": 0,
            "15": 0,
            "20": 0,
            "25": 0,
            "30": 0,
            "35": 0,
            "40": 0,
            "45": 0,
            "5": 0,
            "50": 0,
            "55": 0,
            "60": 0,
            "65": 0,
            "70": 0,
            "75": 0,
            "80": 0,
            "85": 0,
            "90": 0,
            "95": 0
        },
        "organisation_id": "Bbgwg",
        "player_loads": 3,
        "title_private": "How to Clean Your Bike",
        "title_public": "OPQS Tech _ Training How to Clean Your Bike.mp4",
        "video_duration": 428,
        "video_id": "nfXyx",
        "video_plays": 2,
        "views_per_duration": {
            "0": 2,
            "10": 0,
            "100": 0,
            "15": 0,
            "20": 0,
            "25": 0,
            "30": 0,
            "35": 0,
            "40": 0,
            "45": 0,
            "5": 0,
            "50": 0,
            "55": 0,
            "60": 0,
            "65": 0,
            "70": 0,
            "75": 0,
            "80": 0,
            "85": 0,
            "90": 0,
            "95": 0
        }
    },
    ...
]


GET /analytics/views/:id/video/:video_id

Get views data for a video for your date range

  • date_start - DEFAULT 2012-01-01, specify a start date (inclusive).
  • date_end - DEFAULT NOW(), specify an end date (inclusive) which defaults to today

item value
Access user | system
Full url https://api.buto.tv/v2/analytics/views/{id}/video/{video_id}?date_start={date_start}&date_end={date_end}
verb GET
params string:id string:video_id string:date_start string:date_end

Example usage

#get video analytics for a video during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/analytics/views/Bbgwg/video/12345?date_start=2014-01-01&date_end=2014-01-31

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "video_id": "12345",
    "organisation_id": "Bbgwg",
    "video_duration": 130,
    "complete_views": 4000,
    "bounced_views": 500,
    "player_loads": 50000,
    "video_plays": 5000,
    "date_start": "2014-08-05",
    "date_end": "2014-08-09"
}

GET /analytics/views/:id/video/:video_id/per-day

Get views data for a video for your date range

  • date_start - DEFAULT 2012-01-01, specify a start date (inclusive).
  • date_end - DEFAULT NOW(), specify an end date (inclusive) which defaults to today

item value
Access user | system
Full url https://api.buto.tv/v2/analytics/views/{id}/video/{video_id}/per-day/?date_start={date_start}&date_end={date_end}
verb GET
params string:id string:video_id string:date_start string:date_end

Example usage

#get video analytics for a video during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/analytics/views/Bbgwg/video/12345/per-day/?date_start=2014-01-01&date_end=2014-01-31

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

[
    {
        "day": "2014-08-05",
        "video_id": "12345",
        "organisation_id": "Bbgwg",
        "complete_views": 4000,
        "bounced_views": 500,
        "player_loads": 50000,
        "video_plays": 5000
    },
    {
        "day": "2014-08-05",
        "video_id": "12345",
        "organisation_id": "Bbgwg",
        "complete_views": 1320,
        "bounced_views": 34,
        "player_loads": 85345,
        "video_plays": 12345
    }
]

Collection /analytics/duration-viewed

Get duration viewed analytics

GET /analytics/duration-viewed/:id/video/:video_id

Get duration viewed data for a video for your date range

  • date_start - DEFAULT 2012-01-01, specify a start date (inclusive).
  • date_end - DEFAULT NOW(), specify an end date (inclusive) which defaults to today

item value
Access user | system
Full url https://api.buto.tv/v2/analytics/duration-viewed/{id}/video/{video_id}?date_start={date_start}&date_end={date_end}
verb GET
params string:id string:video_id string:date_start string:date_end

Example usage

#get video analytics for a video during Jan 2014
curl -u API_KEY:x --include https://api.buto.tv/v2/analytics/duration-viewed/Bbgwg/video/12345?date_start=2014-01-01&date_end=2014-01-31

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "video_id": "12345",
    "organisation_id": "Bbgwg",
    "video_duration": "130",
    "complete_views": 4000,
    "bounced_views": 500,
    "average_percentage_viewed": 63,
    "player_loads": 50000,
    "video_plays": 5000,
    "date_start": "2014-08-05",
    "date_end": "2014-08-09",
    "views_per_duration": {
        "0": 5500,
        "5": 1750,
        "10": 3000,
        "15": 4250,
        "20": 5500,
        "25": 6750,
        "30": 8000,
        "35": 9250,
        "40": 10500,
        "45": 11750,
        "50": 13000,
        "55": 14250,
        "60": 15500,
        "65": 16750,
        "70": 18000,
        "75": 19250,
        "80": 20500,
        "85": 21750,
        "90": 23000,
        "95": 24250,
        "100": 5000
    },
    "max_percentage_viewed": {
        "0": 5500,
        "5": 1750,
        "10": 3000,
        "15": 4250,
        "20": 5500,
        "25": 6750,
        "30": 8000,
        "35": 9250,
        "40": 10500,
        "45": 11750,
        "50": 13000,
        "55": 14250,
        "60": 15500,
        "65": 16750,
        "70": 18000,
        "75": 19250,
        "80": 20500,
        "85": 21750,
        "90": 23000,
        "95": 24250,
        "100": 5000
    }
}