Skip to content

Instantly share code, notes, and snippets.

@DwarflinDeveloping
Created August 8, 2021 05:37
Show Gist options
  • Save DwarflinDeveloping/caecdf0b7f3f4a473165928b6874e9db to your computer and use it in GitHub Desktop.
Save DwarflinDeveloping/caecdf0b7f3f4a473165928b6874e9db to your computer and use it in GitHub Desktop.
A Python script that checks if a Minecraft username is already taken
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