code: def get_input_key():
      
      click.secho("No API key found!", fg="yellow", bold=True)
      click.secho("Please visit {} and get an API token.".format(RequestHandler.BASE_URL),
                  fg="yellow",
                  bold=True)
      while True:
          confkey = click.prompt(click.style("Enter API key",
                                             fg="yellow", bold=True))
          if len(confkey) == 32:  # 32 chars
              try:
                  int(confkey, 16)  # hexadecimal
              except ValueError:
                  click.secho("Invalid API key", fg="red", bold=True)
              else:
                  break
          else:
              click.secho("Invalid API key", fg="red", bold=True)
      return confkey
docs: Input API key and validate