Bungie-net / api

Resources for the Bungie.net API
Other
1.22k stars 92 forks source link

Seasonal character stats #906

Open insanetron75 opened 5 years ago

insanetron75 commented 5 years ago

Hello!

I am building a leader board for me and my friends. I have an all time leader board finished, but now we want per season stats.

I see you can put in a date range and the documentation says the character stats end point can return 'allTime', 'daily' and 'monthly". But when I put in a date range for say, season 5 (27-11-2018 — 05-03-2019) it says invalid parameters. If I do it with a date range of < 30 days it works and gives me the daily stats.

Is there a way to have a larger date range and/or to get the stats monthly rather than daily like in the documentation?

vthornheart-bng commented 5 years ago

Are you calling GetHistoricalStats to get at this data?

Unfortunately, we have a limit to the number of days that can be fetched in a single query (31). Due to performance reasons, we can't currently allow for more than that in a single query: however, as an alternative you could make three queries and get each month in a separate request! Try that out when you get the chance, and let me know if that resolves the issue for you!

floatingatoll commented 5 years ago

Does the documentation state this limit?

On Fri, Apr 12, 2019 at 12:45 PM Vendal Thornheart notifications@github.com wrote:

Are you calling GetHistoricalStats to get at this data?

Unfortunately, we have a limit to the number of days that can be fetched in a single query (31). Due to performance reasons, we can't currently allow for more than that in a single query: however, as an alternative you could make three queries and get each month in a separate request! Try that out when you get the chance, and let me know if that resolves the issue for you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

vthornheart-bng commented 5 years ago

It does not! Good call, I'll add that in to the description of those properties.

insanetron75 commented 5 years ago

I now do a loop through the daily objects for each 30/31 day period. However the total kills doesn't add up. For example my account has an allTimePvP kill count of roughly 18,000 but after going through each day until the end of season 5 my kill count sits around 9,000.

Is there anyway to do something like an "forPeriod" or add back in the "monthly" objects to rule out any potential errors when looping?