def validate_parameters params = {}
      params.symbolize_keys!
      params.delete(:db) unless DBS.include?(params[:db].try(:to_sym))
      params.delete(:report_type) unless REPORT_TYPES.include?(params[:report_type].try(:to_sym))
      params.delete(:request_type) unless REQUEST_TYPES.include?(params[:request_type].try(:to_sym))
      @parameters = {:db => "us", :api_key => Semrush.api_key, :limit => "", :offset => "", :export_columns => "", :display_sort => "", :display_filter => "", :display_date => ""}.merge(@parameters).merge(params)
      raise Semrush::Exception::Nolimit.new(self, "The limit parameter is missing: a limit is required.") unless @parameters[:limit].present? && @parameters[:limit].to_i>0
      raise Semrush::Exception::BadArgument.new(self, "Request parameter is missing: Domain name, URL, or keywords are required.") unless @parameters[:request].present?
      raise Semrush::Exception::BadArgument.new(self, "Bad db: #{@parameters[:db]}") unless DBS.include?(@parameters[:db].try(:to_sym))
      raise Semrush::Exception::BadArgument.new(self, "Bad report type: #{@parameters[:report_type]}") unless REPORT_TYPES.include?(@parameters[:report_type].try(:to_sym))
      raise Semrush::Exception::BadArgument.new(self, "Bad request type: #{@parameters[:request_type]}") unless REQUEST_TYPES.include?(@parameters[:request_type].try(:to_sym))
    end
def validate_parameters params = {}
      params.symbolize_keys!
      params.delete(:db) unless DBS.include?(params[:db].try(:to_sym))
      params.delete(:report_type) unless REPORT_TYPES.include?(params[:report_type].try(:to_sym))
      params.delete(:request_type) unless REQUEST_TYPES.include?(params[:request_type].try(:to_sym))
      @parameters = {:db => "us", :api_key => Semrush.api_key, :limit => "", :offset => "", :export_columns => "", :display_sort => "", :display_filter => "", :display_date => ""}.merge(@parameters).merge(params)
      raise Semrush::Exception::Nolimit.new(self, "The limit parameter is missing: a limit is required.") unless @parameters[:limit].present? && @parameters[:limit].to_i>0
      raise Semrush::Exception::BadArgument.new(self, "Request parameter is missing: Domain name, URL, or keywords are required.") unless @parameters[:request].present?
      raise Semrush::Exception::BadArgument.new(self, "Bad db: #{@parameters[:db]}") unless DBS.include?(@parameters[:db].try(:to_sym))
      raise Semrush::Exception::BadArgument.new(self, "Bad report type: #{@parameters[:report_type]}") unless REPORT_TYPES.include?(@parameters[:report_type].try(:to_sym))
      raise Semrush::Exception::BadArgument.new(self, "Bad request type: #{@parameters[:request_type]}") unless REQUEST_TYPES.include?(@parameters[:request_type].try(:to_sym))
    end
All parameters:
 * db - requested database
 * report_type - type of the report
 * api_key - user identification key, you can find it in your profile on the Semrush site
 * request_type - type of the request.
 * request - your request
 * limit - number of results returned
 * offset - says to skip that many results before beginning to return results to you
 * export_columns - list of column names, separated by coma. You may list just the column names you need in an order you need.
 * display_sort - a sorting as a String eg: 'am_asc' or 'am_desc'(read http://www.semrush.com/api)
 * display_filter - list of filters separated by "|" (maximum number - 25). A filter consists of <sign>|<field>|<operation>|<value> (read http://www.semrush.com/api)

 more details in http://www.semrush.com/api.html