Articles

Print

API Statistics

Written by Waz. Posted in API Documentation

The Statistics sections of the API gives you endpoints for retrieving statistical information about your videos.

 

Verbs

  • Get - Gets the statistics for a video on demand, information retrieved includes total views, unique views, total viewing time, viewer locations, cost breakdown for bandwidth, storage and transcode, also included is a breakdown of the timings for each viewing of the video (useful for creating your own graph displays)

 

Get

Returns the statistical information about a video on demand (vod)

Request

URL:

  • http://console.247platform.com/api/statistics/get/[videoId]?sessionId=[Session ID]&userId=[Client Id]&reportType=vod

Params:

  • `videoId` (required) Integer, the videoid to retrieve statistical information for

Response 

{
  "logs":{
    "total":12,
    "vod":12
  },
  "cost":{
    "total":23.564220929056,
    "vod":23.564220929056
  },
  "data":{
    "total":{
      "sum":160794485510,
      "in":0,
      "out":160794485510
    },
    "vod":{
      "sum":160794485510,
      "in":0,
      "out":160794485510
    }
  },
  "views":{
    "total":"15821",
    "totalMinutes":109314,
    "uniqieCountries":88
  },
  "times":{
    "startTime":{
      "unix":1368122460,
      "human":"2013-05-09 18:02:42"
    },
    "endTime":{
      "unix":1374591540,
      "human":"2013-07-23 14:58:54"
    },
    "log":{
      "1368122940":{
        "count":{
          "total":1,
          "vod":1
        },
        "created":{
          "readable":"2013-05-09 18:14:42",
          "unix":1368123282
        },
        "from":{
          "readable":"2013-05-09 18:02:42",
          "unix":1368122562
        },
        "mean":{
          "readable":"2013-05-09 18:09:00",
          "unix":1368122940
        },
        "diff":720
      }
      "1374582720":{
        "count":{
          "total":1,
          "vod":1
        },
        "created":{
          "readable":"2013-07-23 12:38:12",
          "unix":1374583092
        },
        "from":{
          "readable":"2013-07-23 12:25:13",
          "unix":1374582313
        },
        "mean":{
          "readable":"2013-07-23 12:32:00",
          "unix":1374582720
        },
        "diff":779
      },
      ...
      ...
      ...
      TRUNCATED FOR READBILITY
      
    }
  },
  "geo":{
    "uniqieIps":{
      "total":8634,
      "vod":8634
    },
    "locations":{
      "EU":{
        
        "Slovakia|SK":{
          "countryCount":7,
          "cities":{
            "Kosice":1,
            "Bratislava":4,
            "unknown":1,
            "Nitra":1
          },
          "full":{
            "Kosice":{
              "Nizna Slana":1
            },
            "Bratislava":{
              "Bratislava":4
            },
            "unknown":{
              "unknown":1
            },
            "Nitra":{
              "Nov":1
            }
          }
        },
        "Hungary|HU":{
          "countryCount":4,
          "cities":{
            "Veszprem":1,
            "Miskolc":1,
            "Budapest":1,
            "Heves":1
          },
          "full":{
            "Veszprem":{
              "Ajka":1
            },
            "Miskolc":{
              "Miskolc":1
            },
            "Budapest":{
              "Budapest":1
            },
            "Heves":{
              "B":1
            }
          }
        },
        "Czech Republic|CZ":{
          "countryCount":12,
          "cities":{
            "Olomoucky kraj":3,
            "Stredocesky kraj":2,
            "Jihomoravsky kraj":1,
            "Hlavni mesto Praha":4,
            "Moravskoslezsky kraj":1,
            "Pardubicky kraj":1
          },
          "full":{
            "Olomoucky kraj":{
              "Sumperk":1,
              "Olomouc":2
            },
            "Stredocesky kraj":{
              "Horovice":1,
              "Kutna Hora":1
            },
            "Jihomoravsky kraj":{
              "Brno":1
            },
            "Hlavni mesto Praha":{
              "Prague":4
            },
            "Moravskoslezsky kraj":{
              "Havirov":1
            },
            "Pardubicky kraj":{
              "Tremosnice":1
            }
          }
        },
        "Spain|ES":{
          "countryCount":64,
          "cities":{
            "unknown":11,
            "Comunidad Valenciana":10,
            "Canarias":7,
            "Castilla y Leon":1,
            "Madrid":5,
            "Islas Baleares":8,
            "Andalucia":7,
            "Murcia":2,
            "Catalonia":9,
            "Galicia":1,
            "Extremadura":1,
            "Castilla-La Mancha":1,
            "Pais Vasco":1
          },
          "full":{
            "unknown":{
              "unknown":11
            },
            "Comunidad Valenciana":{
              "Alicante":2,
              "Valencia":4,
              "Dolores":1,
              "Benidorm":1,
              "Guardamar Del Segura":1,
              "Torrevieja":1
            },
            "Canarias":{
              "Las Palmas":3,
              "Arrecife":2,
              "Telde":1,
              "Santa Cruz De Tenerife":1
            },
            "Castilla y Leon":{
              "Valladolid":1
            },
            "Madrid":{
              "Madrid":4,
              "M":1
            },
            "Islas Baleares":{
              "Palma De Mallorca":5,
              "Ciudadela":2,
              "Mercadal":1
            },
            "Andalucia":{
              "Mijas":3,
              "M":4
            },
            "Murcia":{
              "Murcia":1,
              "Los Alc":1
            },
            "Catalonia":{
              "Girona":4,
              "Barcelona":3,
              "Gav":1,
              "Sant Just Desvern":1
            },
            "Galicia":{
              "A Coru":1
            },
            "Extremadura":{
              "Plasencia":1
            },
            "Castilla-La Mancha":{
              "Horcajo De Santiago":1
            },
            "Pais Vasco":{
              "Legorreta":1
            }
          }
        },
        "Estonia|EE":{
          "countryCount":1,
          "cities":{
            "Harjumaa":1
          },
          "full":{
            "Harjumaa":{
              "Tallinn":1
            }
          }
        }
      ...
      ...
      ...
      TRUNCATED FOR READBILITY
      }
    }
  },
  "created":{
    "timestamp":1374591832,
    "readable":"2013-07-23T15:03:52+00:00"
  },
  "transcodeCosts":2.00,
  "bandwidthCosts":21.564220929056,
  "storageCosts":{
    
  }
}