Retrieve UUID/name only
Is there a way to retrieve only uuid and name to save response time?
What do you mean?
This is crafthead's response for example:
{ "id": "7b793a96313740459e73b3811015fc93", "name": "Reply", "properties": [ { "name": "textures", "value": "ewogICJ0aW1lc3RhbXAiIDogMTYzNTA3NzY2MDA5MywKICAicHJvZmlsZUlkIiA6ICI3Yjc5M2E5NjMxMzc0MDQ1OWU3M2IzODExMDE1ZmM5MyIsCiAgInByb2ZpbGVOYW1lIiA6ICJSZXBseSIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8xMjRmMWQ5ZGRiNjgyZmIwNWU1Yzg1YTQyZGU2ZTc2M2ZkOWM0NjYwYjcyYjJjODgwMWE3NTA3YjMyNDJmODk1IgogICAgfQogIH0KfQ==", "signature": "hr7Jue105aNdFUVX0jjbfuw77SNlESszDItte8wVlJrNkJCJ69IVS4y/6J8XamO7AY6n2cBU1tGisvL5zgKmfpvw58ZaDel4HClBQF8VOztr3vR1+7qffcR3iC3+1EAhfgVl+FU3lGoEVrHPrxWn7WOuCt0DSq7zB1KIEywyrmFEX2yVQG/2ddTE+uENz5ZBpiO2dM1qaPF52xRH9mWOtWDtmzQ56glA/Zba/D7kF3XOYXW//Hj8dfBYoR8l3jMop4mEogc3NoHNWs3UEWAGANDpR9qoVa9nAxlPPutbOEYIBI+v4TDrQJvBVoTgXmUh9ypR6EnCw6IozL+RyA6fkZrAoPw8mFiXJVPt/m07DTFsbtLH9FIY+49DPdFaQWs73OvWtFcQzEd0jXuKAYNCv6FJk0+jM3dYkCGohAbxLw8Bn3xV1Xk870BRozYfiteRePztja98/Pqy27Fz36s7vkOgHHSAY0bf1h1oAJ6f1iLtsGP7SCEZy8Ve/DQTawvnZ8SLZrHUPj91m8IVK+Xu+f4qGfigbsunJGdvgaGlNmtu2Wvj7XwVjzh6ZxtFjzk+mTawBIxmqh6z4EPQUxul/QcnsscdRMdXLjDiPwx2DlZM+owN+ksl026/JBDo9FH1l+Sacj/qo4X4sNHSKhAZZYzK+nhf8ovtVEjmeCqu8rI=" } ] }
vs original response:
{ "name": "Reply", "id": "7b793a96313740459e73b3811015fc93" }
doesn't it require more time to get the response, with textures and signature?
Crafthead caches the entire profile, not just the username<->UUID mapping. There is some added cost to this and it may be worth implementing a "light" mode to just do the mapping, but I'd want to see some demand first.
Crafthead caches the entire profile, not just the username<->UUID mapping. There is some added cost to this and it may be worth implementing a "light" mode to just do the mapping, but I'd want to see some demand first.
That would be really nice, to get higher demand crafthead's uuid api should be more promoted, but if it has same issues as Electroid's weird bugs (premium as no-premium on error) it will be harder I think.
I would recommend simply using the /profile endpint, or PlayerDB for this, which Crafthead now uses internally:
https://playerdb.co/api/player/minecraft/7b793a96313740459e73b3811015fc93
PlayerDB's p90 response time is ~150ms, with lots of caching, with p75 at ~15ms. PlayerDB has a tonne of proxies and things setup to avoid common issues that come with being on Workers today (rate limiting, etc.). I'm not sure there'd be any real speed improvements here, outside of a tiny amount of bandwidth reduction due to response size.