def METHOD_NAME(query):
    parameters = {
        'q': query,
        'page': 0,
    }
    try:
        response = requests.post(SEARCHXKCD_API, params=parameters)
    except requests.exceptions.ConnectionError as e:
        LOGGER.debug("Unable to reach searchxkcd API: %s", e)
        return None
    except Exception as e:
        LOGGER.debug("Unexpected error calling searchxkcd API: %s", e)
        return None
    try:
        hits = response.json()['results']['hits']
        if not hits:
            return None
        first = hits[0]['objectID']
    except (JSONDecodeError, LookupError):
        LOGGER.debug("Data format from searchxkcd API could not be understood.")
        return None
    return first