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

days parameter in history endpoint not working #397

Closed Sagi44 closed 6 years ago

Sagi44 commented 6 years ago

I suspect that the history endpoint is not respecting the "days" parameter as described in :

https://docs.royaleapi.com/#/endpoints/clan_history

Request Details:

GET https://api.royaleapi.com/Clan/PPYJ0V/history?10 Should return last 10 ClanHistoryRecords. Instead Returns ALL ClanHistoryRecords ever since tracking enabled..

Gr8z commented 6 years ago

I think you misunderstood the parameter. The "?days" query string can be specified to limit the number of days of data to return. That does not mean doing ?days=2 will return 2 results. One day can have multiple results as your clan is tracked every 4 hours.

E.g: https://api.royaleapi.com/Clan/PPYJ0V/history?days=3 - will return data recorded during 6/30 to 7/2 + today's data.

Sagi44 commented 6 years ago

Thanks. So can I count on 6 records per day ?

Gr8z commented 6 years ago

No, you should not. API can go offline or game can have maintenance which can lead to your clan not being tracked at the scheduled time. Making it possible not to have 6 records of history per day. You should not rely on counting but should check the timestamp in your application.