Lookup BuiltWith results for the given domain. If API version 2 is used and the get_last_full_query flag
        enabled, it also queries for the date of the last full BuiltWith scan.

def lookup(self, domain, get_last_full_query=True):
        """
        Lookup BuiltWith results for the given domain. If API version 2 is used and the get_last_full_query flag
        enabled, it also queries for the date of the last full BuiltWith scan.
        """

        last_full_builtwith_scan_date = None

        if self.api_version == 7 and isinstance(domain, list):
            domain = ','.join(domain)

        if self.api_version in [2, 7]:
            last_updates_resp = requests.get(ENDPOINTS_BY_API_VERSION[self.api_version], params={'UPDATE': 1})
            last_updated_data = last_updates_resp.json()

            if get_last_full_query and last_updated_data['FULL']:
              last_full_builtwith_scan_date = datetime.datetime.strptime(last_updated_data['FULL'], '%Y-%m-%d').date()

        params = {
            'KEY': self.key,
            'LOOKUP': domain,
        }

        response = requests.get(ENDPOINTS_BY_API_VERSION[self.api_version], params=params)

        if self.api_version == 1:
            return response.json()
        elif self.api_version == 2:
            return BuiltWithDomainInfo(response.json(), last_full_builtwith_scan_date)
        elif self.api_version == 7:
            domain_info = list()
            for result in response.json()['Results']:
                domain_info.append(BuiltWithDomainInfo(result['Result'], last_full_builtwith_scan_date))
            return domain_info