import requests


def get_asn(ip_address):
    """Get the ASN details of a give IP address."""
    try:
        data = requests.get(
            "https://api.iptoasn.com/v1/as/ip/{}".format(ip_address), timeout=5
        ).text
        return data
    except requests.exceptions.ConnectionError:
        return None