def __init__(self, api_key, endpoint, domain, start_month, end_month,<EOL>time_granularity="<STR_LIT>", main_domain_only=False):
if endpoint not in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>raise InvalidEndpointException("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>self.endpoint = endpoint<EOL>self.domain = utils.domain_from_url(domain)<EOL>self.start_month = start_month<EOL>self.end_month = end_month<EOL>self.time_granularity = time_granularity<EOL>self.main_domain_only = main_domain_only<EOL>super(EngagementAPI, self).__init__(api_key)<EOL>
Parameters
----------
api_key: string
    SimilarWeb API key

endpoint: string
    Endpoint to use. Can be: pageviews, visitduration, bouncerate

domain: string
    Domain to query.

start_month: string
    Start Month in (M-YYYY) format

end_month: string
    End Month in (M-YYYY) format

time_granularity: string
    Time granularity of report. Can be: Daily, Weekly, Monthly

main_domain_only: boolean
    Get metrics on the Main Domain only (i.e. not including subdomains)