module Similarweb::DesktopTraffic::Sources

Public Instance Methods

overview(domain, start_date, end_date) click to toggle source
# File lib/similarweb/desktop_traffic/sources.rb, line 12
def overview(domain, start_date, end_date)
  response = self.http_client.get "v1/website/#{domain}/traffic-sources/overview?api_key=#{self.api_key}&start_date=#{start_date}&end_date=#{end_date}&main_domain_only=false"
  JSON.parse(response.body)
end
overview_share(domain, start_date, end_date) click to toggle source

NOTE: start_date, end_date format: YYYY-MM

# File lib/similarweb/desktop_traffic/sources.rb, line 7
def overview_share(domain, start_date, end_date)
  response = self.http_client.get "v1/website/#{domain}/traffic-sources/overview-share?api_key=#{self.api_key}&start_date=#{start_date}&end_date=#{end_date}&main_domain_only=false"
  JSON.parse(response.body)
end