Skip to content

How to Obtain a Skin?

This guide will help you obtain the skin file for yourself or another player.

In this context, a “skin” refers to an image, typically in PNG format, with a resolution of 64x64 for newer versions and 64x32 for older ones.

The easiest way to obtain a skin is by using the NameMC service. Using the site’s search, you can find the desired player and download their skin.

Use the official Mojang API if you need to retrieve a skin directly in your code. The API documentation is described on Minecraft.wiki.

The following examples will assist you in obtaining the skin:

from base64 import b64decode
import json
import requests # requires installation from pypi
player_nickname = "jeb_"
filename = "my_skin.png"
player_uuid = requests.get(f"https://api.minecraftservices.com/minecraft/profile/lookup/name/{player_nickname}").json()["id"]
textures = json.loads(b64decode(requests.get(f"https://sessionserver.mojang.com/session/minecraft/profile/{player_uuid}").json()["properties"][0]["value"]))["textures"]
skin_url = textures["SKIN"]["url"]
is_slim = textures["SKIN"]["metadata"]["model"] == "slim" if "metadata" in textures["SKIN"] else False
skin = requests.get(skin_url)
with open(filename, mode='wb') as file:
file.write(skin.content)
print(f"Skin downloaded to {filename}")
print(f"Is slim model: {is_slim}")