I am coding a bot for discord using discord.py and I have a command to authenticate Minecraft accounts with the server. I would like to check the accounts with the API to make sure they are valid. right now, I am able to use requests to check if the Java account is valid using this code:
import requests
import discord
username = 'playersusername' #the player username would be replaced with a value coming from the bot, this is just test code
url = f'https://api.mojang.com/users/profiles/minecraft/{username}?'
javacheck = requests.get(url)
status = javacheck.status_code
print(javacheck.status_code)
if status != 204: #makes sure the page exists. when it doesn't the api throws 204
uuid = javacheck.json()['ID']
print(uuid)
However, I am unable to find any way to make this work with the Xbox Live API (for my bedrock edition players) can anyone help push me in the right direction?