import requests

def check_bin_info(bin):
    api_url = f"https://astroboyapi.com/api/bin.php?bin={bin}"

    try:
        response = requests.get(api_url)
        response.raise_for_status()

        bin_info = response.json()

        if 'error' in bin_info:
            print(f"Error: {bin_info['error']}")
        else:
            print("BIN Information:")
            print(f"BIN: {bin_info['bin']}")
            print(f"Brand: {bin_info['brand']}")
            print(f"Country: {bin_info['country_name']}")
            print(f"Bank: {bin_info['bank']}")
            print(f"Level: {bin_info['level']}")
            print(f"Type: {bin_info['type']}")
            print(f"BIN API By: {bin_info['bin_api_by']}")
    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    bin = input("Enter a BIN: ")
    check_bin_info(bin)