RoyaleAPI / cr-api

Clash Royale Analytics, Profiles and Insights. We no longer publish a public API. Please use the official API from Supercell.
https://RoyaleAPI.com
167 stars 20 forks source link

Endpoint tournament new filter tournaments/notfull #369

Closed Tithanium closed 6 years ago

Tithanium commented 6 years ago

Usually, the query with enpoints https://api.royaleapi.com/tournaments/open?prep=1 returns 100 open tournements...

but it would be great to have an enpoint such as : https://api.royaleapi.com/tournaments/open?notfull=1 to get tournaments tag that are not full from the API data. or https://api.royaleapi.com/tournaments/open?emptyslots=10 to get tournaments tag that have at least 10 empty slots ?

Would it be possible ? Thanks again for all this work.

fourjr commented 6 years ago

Related to #284

selfish commented 6 years ago

Thanks for the idea. Might make this fancier in the future, for now: Added /joinable endpoint, and ?joinable=1 param. (As well as /full and ?full=q)

[ @fourjr #docs ]

fourjr commented 6 years ago

This issue was moved to RoyaleAPI/cr-api-docs#37

Tithanium commented 6 years ago

I did try the endpoints https://api.royaleapi.com/tournaments/open?full=1 and https://api.royaleapi.com/tournaments/open?full=0

but didn't get different kind of results. What is this supposed to filter ? Thanks in advance.

fourjr commented 6 years ago

full=0 and full=1 is the same thing.. use joinable to filter out not full tournaments

Tithanium commented 6 years ago

ok. I tried, but it finds tournaments with supposedly max-1 personnes, and eventually, the next verification request find out it is already full... (you can also connect to the game to check this out, this is really quick) This is the reason why I asked for the enhancement of an endpoint that returns tournaments that have a specified number of empty slot. Currently, Selfish did a great job but the returned API data is eventually of only full or full in the next secondes tournaments (even if I can retreive 100 tournements ...).