Reputation: 11
I'm building a Website on which you can enter your Minecraft UUID and it gives you a 3D Render of your Minecraft Skin. Unfortunately the API I am using only supports UUIDs. I thought the website could work like this:
How can this be done?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" media="screen" href="https://fontlibrary.org//face/minecraftia" type="text/css"/>
<title>Check Minecraft Skin!</title>
<script src="https://kit.fontawesome.com/c0ac5a1789.js" crossorigin="anonymous"></script>
</head>
<body>
<main>
<input type="text" id="skinname" placeholder="Enter your UUID" />
<button class="button">Search</button>
<div class="output">
<img id="image"/>
</div>
<script>
const skinname = document.getElementById("skinname");
const button = document.querySelector("button");
const image = document.getElementById("image");
button.addEventListener("click", async () => {
const rta = await fetch(
"https://visage.surgeplay.com/full/500/" + skinname.value
);
image.src = rta.url;
});
</script>
</main>
</body>
</html>
Upvotes: 1
Views: 1276
Reputation: 181
You can use official Mojang API
https://api.mojang.com/users/profiles/minecraft/<username>
Upvotes: 2