mojang-api icon indicating copy to clipboard operation
mojang-api copied to clipboard

Speed

Open andreasdc opened this issue 3 years ago • 10 comments

Wouldn't it be faster to make 1 url just for uuid?

andreasdc avatar Nov 15 '21 09:11 andreasdc

How would it be faster? There is a check if a username or uuid was given, and if username - it first searches for uuid by username and then find anything else

sadcenter avatar Nov 18 '21 17:11 sadcenter

Yeah, an if-else statement is not going to make it slower. See https://github.com/Electroid/mojang-api/blob/master/src/api.coffee#L24.

harvanchik avatar Nov 18 '21 18:11 harvanchik

How would it be faster? There is a check if a username or uuid was given, and if username - it first searches for uuid by username and then find anything else

You have textures and signature in the same link. And it often works slower than Mojang's url.

andreasdc avatar Nov 18 '21 18:11 andreasdc

How would it be faster? There is a check if a username or uuid was given, and if username - it first searches for uuid by username and then find anything else

You have textures and signature in the same link. And it often works slower than Mojang's url.

This is the wrong API for you then. This API is for getting all the the information in one request rather than multiple. It will be slower that way.

harvanchik avatar Nov 18 '21 18:11 harvanchik

How would it be faster? There is a check if a username or uuid was given, and if username - it first searches for uuid by username and then find anything else

You have textures and signature in the same link. And it often works slower than Mojang's url.

This is the wrong API for you then. This API is for getting all the the information in one request rather than multiple. It will be slower that way.

But it has no rate limits right?

andreasdc avatar Nov 18 '21 18:11 andreasdc

I could add some query parameters, or another endpoint to configure what you want/don't want. That should make it faster depending on your exact needs (say, if you don't need textures)

Electroid avatar Nov 19 '21 19:11 Electroid

I could add some query parameters, or another endpoint to configure what you want/don't want. That should make it faster depending on your exact needs (say, if you don't need textures)

That's a great idea actually -- the query parameters.

harvanchik avatar Nov 19 '21 20:11 harvanchik

I could add some query parameters, or another endpoint to configure what you want/don't want. That should make it faster depending on your exact needs (say, if you don't need textures)

Sounds cool, your api doesn't have rate limits right? Also could you look into this issue? https://github.com/Electroid/mojang-api/issues/49

andreasdc avatar Nov 19 '21 20:11 andreasdc

I could add some query parameters, or another endpoint to configure what you want/don't want. That should make it faster depending on your exact needs (say, if you don't need textures)

Yea, that would be very useful for me. I'm writing my own implementation of mojang authlib and want to use your API because timings are nice but your API provides too much (sometimes useless) data. I just need textures from username for instance.

sadcenter avatar Nov 19 '21 20:11 sadcenter

I could add some query parameters, or another endpoint to configure what you want/don't want. That should make it faster depending on your exact needs (say, if you don't need textures)

Is mojang/v2/uuid safe to use to just get uuid of premium player? Please check this issue too https://github.com/Electroid/mojang-api/issues/49

andreasdc avatar Nov 22 '21 22:11 andreasdc

You can use: https://api.ashcon.app/mojang/v2/uuid/Notch to just get the UUID.

Electroid avatar Dec 15 '22 21:12 Electroid

You can use: https://api.ashcon.app/mojang/v2/uuid/Notch to just get the UUID.

I see it returns normal 404 http response code in my java app, am I right? It returns 404 when player is offline mode, right?

andreasdc avatar Dec 15 '22 23:12 andreasdc