Public API should return EVERYTHING the player has

Sort:
Eyal282

Lichess does it, searching up a player's username will return profile preferences, patron status, rating, etc... And it makes everything much easier, because all you need is one query. I have a discord bot that shows wings for Lichess patrons for not for Chess.com, because I don't want to bother 2 API calls just for the extra diamond / gold icon for premium members.

WhiteDrake

If you just want to know if a player is a premium member, than a single API call is all that is needed:

I don't think that the published API currently offers to get the information if a given player is gold, platinum or diamond, though.

inf

yeah, it would be neat if they also return the membership tier. 0 for basic, 1 for gold; 2 for platinum etc

Eyal282
WhiteDrake wrote:

If you just want to know if a player is a premium member, than a single API call is all that is needed:

I don't think that the published API currently offers to get the information if a given player is gold, platinum or diamond, though.

 

My discord bot fetches the player's rating. My care for his premium is 1%. My care for his rating is 99%. If the call to the rating won't give me his premium, I won't attach it to the profile.

 

https://lichess.org/api/user/Eyal282

 

Look at this. Literally everything is given. No detail is missing from me. Profile, Patron ( missing because I'm normal ) and rating

WhiteDrake

OK, and what is exactly the problem with making a second API call? Performance is definitely not an issue. If you were taking the data directly from the database, you wouldn't complain about a single additional join needed, what's the issue here? Splitting data into several API points seems like a legitimate design choice to me - it has some pros and some cons, as it is with every design decision.

Eyal282
WhiteDrake wrote:

OK, and what is exactly the problem with making a second API call? Performance is definitely not an issue. If you were taking the data directly from the database, you wouldn't complain about a single additional join needed, what's the issue here? Splitting data into several API points seems like a legitimate design choice to me - it has some pros and some cons, as it is with every design decision.

 

It is just the issue of the better alternative being there.

 

I won't bother making another API call for something which is rather trivial for my bot.

Eyal282
WhiteDrake wrote:

OK, and what is exactly the problem with making a second API call? Performance is definitely not an issue. If you were taking the data directly from the database, you wouldn't complain about a single additional join needed, what's the issue here? Splitting data into several API points seems like a legitimate design choice to me - it has some pros and some cons, as it is with every design decision.

 

It literally doubles the time to perform it, calls outside my application are the longest to perform. Again, I cannot bother unless it's on a golden plate. The rating ia a critical feature. The account's creation date & premium is a nice touch.

 

Also if you add this do actually add the type of premium

dimpoul

Both user and stats APIs are very snappy. I don't understand why making two calls in the samewill degrade your performance so much. I am doing multiple separate calls in my chat bot on twitch for such issues ie. to get game archives and games analysis or in much simpler stats/elo type of commands. Just have two separate API calls in the same command in your discord bot