Documentation

Total Engagement API

Gain access to three engagement metrics – average pageviews per visit, average visit duration, and bounce rate.

Using those APIs, you’ll be able to query any website to obtain the relevant data with monthly, weekly, or daily granularity.



End Points

Average Pageviews per visit: pages-per-visit

Average Visit Duration: average-visit-duration

Bounce Rate: bounce-rate



Parameters

Params Description
Domain Enter your target domain including only the top-level and second-level names, ie: "cnn.com", "edition.cnn.com"
Start Month (start_date) Start Month (YYYY-MM)
End Month (end_date) End Month (YYYY-MM)
Main Domain (main_domain_only) True /False
True returns data for main domain only
False returns data for subdomains as well.
UserKey (api_key) Enter your unique API Key
Granularity (granularity) Daily/Weekly/Monthly
Returns data in requested format

Example: Average Page views per visit API input for “cnn.com”

{
    https://api.similarweb.com/v1/website/cnn.com/total-traffic-and-engagement/pages-per-visit?api_key={UserKey}&start_date=2016-01&end_date=2016-03&main_domain_only=false&granularity=monthly

}

Example: Average Page views per visit API output for “cnn.com”

{
    {  
   "meta":{  
      "request":{  
         "granularity":"Monthly",
         "main_domain_only":false,
         "domain":"cnn.com",
         "start_date":"2016-01-01",
         "end_date":"2016-03-31",
         "country":"world"
      },
      "status":"Success",
      "last_updated":"2016-10-31"
   },
   "pages_per_visit":[  
      {  
         "date":"2016-01-01",
         "pages_per_visit":2.2109475257658016
      },
      {  
         "date":"2016-02-01",
         "pages_per_visit":2.3107032764424376
      },
      {  
         "date":"2016-03-01",
         "pages_per_visit":2.3407999203216256
      }
   ]
}
}

Example: Average Visit Duration API input for “cnn.com”

{
   https://api.similarweb.com/v1/website/cnn.com/total-traffic-and-engagement/average-visit-duration?api_key={UserKey}&start_date=2016-01&end_date=2016-03&main_domain_only=false&granularity=monthly


}

Example: Average Visit Duration API output for “cnn.com”

{
 {  
   "meta":{  
      "request":{  
         "granularity":"Monthly",
         "main_domain_only":false,
         "domain":"cnn.com",
         "start_date":"2016-01-01",
         "end_date":"2016-03-31",
         "country":"world"
      },
      "status":"Success",
      "last_updated":"2016-10-31"
   },
   "average_visit_duration":[  
      {  
         "date":"2016-01-01",
         "average_visit_duration":217.28785119413075
      },
      {  
         "date":"2016-02-01",
         "average_visit_duration":231.33437012730832
      },
      {  
         "date":"2016-03-01",
         "average_visit_duration":237.34227032664694
      }
   ]
}

Example: Bounce Rate API input for “cnn.com”

{
  https://api.similarweb.com/v1/website/cnn.com/total-traffic-and-engagement/bounce-rate?api_key={UserKey}&start_date=2016-01&end_date=2016-03&main_domain_only=false&granularity=monthly
}

Example: Bounce Rate API output for “cnn.com”

{
{  
   "meta":{  
      "request":{  
         "granularity":"Monthly",
         "main_domain_only":false,
         "domain":"cnn.com",
         "start_date":"2016-01-01",
         "end_date":"2016-03-31",
         "country":"world"
      },
      "status":"Success",
      "last_updated":"2016-10-31"
   },
   "bounce_rate":[  
      {  
         "date":"2016-01-01",
         "bounce_rate":0.61112244135674609
      },
      {  
         "date":"2016-02-01",
         "bounce_rate":0.59125844840213571
      },
      {  
         "date":"2016-03-01",
         "bounce_rate":0.576010526355393
      }
   ]
}

Please note the country based breakdown of response is available for enterprise user.