def search(self, searchAreaWkt=None, filters=None, startDate=None, endDate=None, types=None):
<EOL>if not types:<EOL><INDENT>types = ['<STR_LIT>']<EOL><DEDENT>if startDate:<EOL><INDENT>startDateTime = datetime.datetime.strptime(startDate, '<STR_LIT>')<EOL><DEDENT>if endDate:<EOL><INDENT>endDateTime = datetime.datetime.strptime(endDate, '<STR_LIT>')<EOL><DEDENT>if startDate and endDate:<EOL><INDENT>diff = endDateTime - startDateTime<EOL>if diff.days < <NUM_LIT:0>:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT><DEDENT>postdata = {<EOL>"<STR_LIT>": searchAreaWkt,<EOL>"<STR_LIT>": types,<EOL>"<STR_LIT>": startDate,<EOL>"<STR_LIT>": endDate,<EOL>}<EOL>if filters:<EOL><INDENT>postdata['<STR_LIT>'] = filters<EOL><DEDENT>if searchAreaWkt:<EOL><INDENT>postdata['<STR_LIT>'] = searchAreaWkt<EOL><DEDENT>url = '<STR_LIT>' % {<EOL>'<STR_LIT>': self.base_url<EOL>}<EOL>headers = {'<STR_LIT:Content-Type>':'<STR_LIT:application/json>'}<EOL>r = self.gbdx_connection.post(url, headers=headers, data=json.dumps(postdata))<EOL>r.raise_for_status()<EOL>results = r.json()['<STR_LIT>']<EOL>return results<EOL>
Perform a catalog search

        Args:
            searchAreaWkt: WKT Polygon of area to search.  Optional.
            filters: Array of filters.  Optional.  Example:
            [
                "(sensorPlatformName = 'WORLDVIEW01' OR sensorPlatformName ='QUICKBIRD02')",
                "cloudCover < 10",
                "offNadirAngle < 10"
            ]
            startDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            endDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            types: Array of types to search for.  Optional.  Example (and default):  ["Acquisition"]

        Returns:
            catalog search resultset