API documentation

Stats ยป GET

Retrieve statistics about the given video.

Arguments

  • from

    Start date range. Form: yyyy-mm-dd
    Eg. 2008-02-01

  • to

    End date range. Form: yyyy-mm-dd
    Eg. 2008-03-31

Note: If no range given, you'll get the statistics for the last 30 days.

Request example

cURL

curl http://heyspread.com/api2/video/550/stats?from=2008-05-06&to=2008-05-07

Ruby

video = HeySpread::Video.find(550)
video.statistics(:from => "2008-05-06", :to => "2008-05-07")
video.statistics(:from => "2008-05-06", :to => "2008-05-07", :format => "csv")

PHP

$video = HeySpread_Video::find(550);
$video->statistics("2008-05-06", "2008-05-07");
$video->statistics("2008-05-06", "2008-05-07", "csv");

Response example

<statistics from="2008-05-06" to="2008-05-07" video-id="550" total-views="123">
  <statistic date="2008-05-06">
    <views site="revver">14</views>
    <views site="veoh">0</views>
    <views site="crackle">0</views>
    <views site="youtube">3</views>
    <views site="vsocial">15</views>
    <views site="yahoo">1</views>
    <views site="dailymotion">2</views>
    <views site="sumo">1</views>
    <views site="metacafe">80</views>
    <views site="google">0</views>
    <views site="myspace">1</views>
    <views site="vimeo">0</views>
    <views site="viddler">0</views>
    <views site="photobucket">0</views>
  </statistic>
  <statistic date="2008-05-07">
    <views site="revver">0</views>
    <views site="veoh">0</views>
    <views site="crackle">0</views>
    <views site="vsocial">3</views>
    <views site="youtube">0</views>
    <views site="sumo">0</views>
    <views site="yahoo">0</views>
    <views site="dailymotion">0</views>
    <views site="metacafe">3</views>
    <views site="google">0</views>
    <views site="vimeo">0</views>
    <views site="myspace">0</views>
    <views site="viddler">0</views>
    <views site="photobucket">0</views>
  </statistic>
</statistics>

Export

You can export the stats in 2 other different formats : RSS, CSV. You just need to add the good extension to the URI:

Note: you can add the range parameters like above.