Created
August 8, 2021 05:37
-
-
Save DwarflinDeveloping/caecdf0b7f3f4a473165928b6874e9db to your computer and use it in GitHub Desktop.
A Python script that checks if a Minecraft username is already taken
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_if_name_is_available(username): | |
import requests | |
proxy = "https://api.mojang.com/users/profiles/minecraft/" | |
url = proxy + username | |
if requests.get(url).content == b'': | |
# If the username is not available, False is returned. | |
return False | |
else: | |
# If the username is available, True is returned. | |
return True | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment