Last active
May 7, 2019 10:18
-
-
Save btarg/edc9a23768c8874c59b933d4e47a8e91 to your computer and use it in GitHub Desktop.
[UPDATED] Get MC UUID from username (for use with APIs like Crafatar)
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
import requests | |
import urllib.request | |
import json | |
while True: | |
username = input("Enter username: ") | |
try: | |
# Make requests to Mojang API and grab info | |
data = urllib.request.urlopen("https://api.mojang.com/users/profiles/minecraft/" + username).read() | |
uuid = json.loads(data)["id"] | |
print(uuid) | |
except: | |
print("\nAn error occurred.\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment