Documentation

Total Traffic API

The Total Traffic API allows you to input a domain and receive the Estimated Number of Visits for the domain on a daily, weekly, or monthly basis for desktop and mobile users.



What are visits?

Visits are the basic unit behind SimilarWeb’s web insights and the basis for most of SimilarWeb’s measurements. A visit is defined as an entry to a web domain from a different web domain or from the beginning of an empty browsing session, and expires after 30 minutes of inactivity. During the duration of the visit, activity occurring within the domain, for example, clicking on articles and pictures, is measured as page-views. SimilarWeb’s definition of a visit is identical to Google Analytics’ definition, which means SimilarWeb can be used to make direct comparisons with the most popular analytics suite on the market.

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: Total Traffic API input for “cnn.com”

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

Example: Total Traffic 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-01",
         "country":"world"
      },
      "status":"Success",
      "last_updated":"2016-05-01"
   },
   "visits":[  
      {  
         "date":"2016-01-01",
         "visits":419183781.12128651
      },
      {  
         "date":"2016-02-01",
         "visits":430178882.01417673
      },
      {  
         "date":"2016-03-01",
         "visits":490074660.2565304
      }
   ]
}

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

Need Help ?