The HistoricalStats endpoint is currently returning the wrong data.
It seems like a lot of matches are currently missing from the aggregation results. In some cases TrialsOfTheNine is reporting 6 matches played, while we can confirm it was 41.
After some additional research we discovered that the aggregation is excluding matches played in the last x days.
the additional research mentioned above:
This is from trials report

This is the response from https://www.bungie.net/platform/Destiny2/2/Account/4611686018457866310/Character/2305843009263184720/Stats/?modes=TrialsOfTheNine

Ah, interesting info - so it looks like the all time results we're returning in this case are equal to what you all have calculated via PGCRs for just week 4.
I'll forward this along and see if we can dig up some info!
Yea, that is what we're thinking as well. Might not be the full week as we only looked at trials.
It seems like this started after the deploy. We got our first support ticket on 17:31UTC about stats being wrong.
Ooh yeah, I'm digging into it now. I have some suspicions.
To note for anyone looking for a workaround: it looks like the root cause is actually that our consolidation of aggregate Activity Modes in this endpoint is not working: it's only returning stats for a single mode in the aggregation. You can work around it temporarily by querying for each of the modes in the aggregate itself and then combining them yourself: a crappy workaround, but one that should work while we continue to investigate.
Keep an eye out for missing GROUP BY clauses!
On Thu, Oct 19, 2017 at 5:34 PM, Vendal Thornheart <[email protected]
wrote:
To note for anyone looking for a workaround: it looks like the root cause
is actually that our consolidation of aggregate Activity Modes in this
endpoint is not working: it's only returning stats for a single mode in the
aggregation. You can work around it temporarily by querying for each of the
modes in the aggregate itself and then combining them yourself: a crappy
workaround, but one that should work while we continue to investigate.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Bungie-net/api/issues/242#issuecomment-338074585, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAFqDGIwxJLLPER8zeN4WB-2gmd4pTVgks5st-qqgaJpZM4P_0bp
.
(note that the workaround above will only work for sure for Trials data... it's a long story, but essentially the way we aggregate data from the server is such that the workaround I mentioned above is not necessarily something that will work for all modes, and basically coincidentally works to work around the issue for Trials)
Sorry about this guys, hang tight and we'll get in a fix as soon as we're allowed to do so.
We found the root cause and have a fix ready. Hopefully we will have this patched in production by Monday at the latest. This bug was introduced while adding a feature that includes the 'activityId' for "best" stats. It lets you look at the PGCR where you got your best score, or most kills, etc. Little solace I know.
@Tetron-bng That'll be a cool feature to have too! Thanks for the update.
@Tetron-bng not sure if this is included in this fix, but Destiny2.GetHistoricalStatsForAccount returns wrong data too (I'd love to have the 74.36 k/d ratio it returns :D)
curl -H "X-API-Key: REDACTED" "https://www.bungie.net/Platform/Destiny2/2/Account/4611686018459911023/Stats/"
allPvP:
{ allTime:
{ activitiesEntered:
{ statId: 'activitiesEntered',
basic: { value: 55, displayValue: '55' } },
activitiesWon:
{ statId: 'activitiesWon',
basic: { value: 10, displayValue: '10' } },
assists:
{ statId: 'assists',
basic: { value: 134, displayValue: '134' },
pga: { value: 4.620689655172414, displayValue: '4.6' } },
totalDeathDistance:
{ statId: 'totalDeathDistance',
basic: { value: 0, displayValue: '0.0' } },
averageDeathDistance:
{ statId: 'averageDeathDistance',
basic: { value: 0, displayValue: '0.0' } },
totalKillDistance:
{ statId: 'totalKillDistance',
basic: { value: 49833, displayValue: '49833.0' } },
kills:
{ statId: 'kills',
basic: { value: 2085, displayValue: '2085' },
pga: { value: 8.551724137931034, displayValue: '8.6' } },
averageKillDistance:
{ statId: 'averageKillDistance',
basic: { value: 45.74923832686533, displayValue: '45.7' } },
secondsPlayed:
{ statId: 'secondsPlayed',
basic: { value: 33182, displayValue: '9h 13m' },
pga: { value: 457.7931034482759, displayValue: '7m 37s' } },
deaths:
{ statId: 'deaths',
basic: { value: 306, displayValue: '306' },
pga: { value: 9.689655172413794, displayValue: '9.7' } },
averageLifespan:
{ statId: 'averageLifespan',
basic: { value: 812.6933987997818, displayValue: '13m 32s' } },
score:
{ statId: 'score',
basic: { value: 382, displayValue: '382' },
pga: { value: 13.172413793103448, displayValue: '13' } },
averageScorePerKill:
{ statId: 'averageScorePerKill',
basic: { value: 1.5403225806451613, displayValue: '2' } },
averageScorePerLife:
{ statId: 'averageScorePerLife',
basic: { value: 1.3546099290780143, displayValue: '1' } },
bestSingleGameKills:
{ statId: 'bestSingleGameKills',
basic: { value: 16, displayValue: '16' },
activityId: '377206225' },
bestSingleGameScore:
{ statId: 'bestSingleGameScore',
basic: { value: 27, displayValue: '27' },
activityId: '377206225' },
killsDeathsRatio:
{ statId: 'killsDeathsRatio',
basic: { value: 74.36256227758008, displayValue: '74.36' } },
killsDeathsAssists:
{ statId: 'killsDeathsAssists',
basic: { value: 74.60099644128114, displayValue: '74.60' } },
objectivesCompleted:
{ statId: 'objectivesCompleted',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
precisionKills:
{ statId: 'precisionKills',
basic: { value: 778, displayValue: '778' },
pga: { value: 3.2758620689655173, displayValue: '3.3' } },
resurrectionsPerformed:
{ statId: 'resurrectionsPerformed',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
resurrectionsReceived:
{ statId: 'resurrectionsReceived',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
suicides:
{ statId: 'suicides',
basic: { value: 4, displayValue: '4' },
pga: { value: 0.034482758620689655, displayValue: '0.0' } },
weaponKillsAutoRifle:
{ statId: 'weaponKillsAutoRifle',
basic: { value: 359, displayValue: '359' },
pga: { value: 4.586206896551724, displayValue: '4.6' } },
weaponKillsFusionRifle:
{ statId: 'weaponKillsFusionRifle',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsHandCannon:
{ statId: 'weaponKillsHandCannon',
basic: { value: 287, displayValue: '287' },
pga: { value: 1.103448275862069, displayValue: '1.1' } },
weaponKillsMachinegun:
{ statId: 'weaponKillsMachinegun',
basic: { value: 3, displayValue: '3' },
pga: { value: 0.10344827586206896, displayValue: '0.1' } },
weaponKillsPulseRifle:
{ statId: 'weaponKillsPulseRifle',
basic: { value: 240, displayValue: '240' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsRocketLauncher:
{ statId: 'weaponKillsRocketLauncher',
basic: { value: 5, displayValue: '5' },
pga: { value: 0.1724137931034483, displayValue: '0.2' } },
weaponKillsScoutRifle:
{ statId: 'weaponKillsScoutRifle',
basic: { value: 461, displayValue: '461' },
pga: { value: 0.6896551724137931, displayValue: '0.7' } },
weaponKillsShotgun:
{ statId: 'weaponKillsShotgun',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsSniper:
{ statId: 'weaponKillsSniper',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsSubmachinegun:
{ statId: 'weaponKillsSubmachinegun',
basic: { value: 28, displayValue: '28' },
pga: { value: 0.20689655172413793, displayValue: '0.2' } },
weaponKillsRelic:
{ statId: 'weaponKillsRelic',
basic: { value: 17, displayValue: '17' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsSideArm:
{ statId: 'weaponKillsSideArm',
basic: { value: 33, displayValue: '33' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsSword:
{ statId: 'weaponKillsSword',
basic: { value: 8, displayValue: '8' },
pga: { value: 0.27586206896551724, displayValue: '0.3' } },
weaponKillsAbility:
{ statId: 'weaponKillsAbility',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsGrenade:
{ statId: 'weaponKillsGrenade',
basic: { value: 82, displayValue: '82' },
pga: { value: 0.3103448275862069, displayValue: '0.3' } },
weaponKillsGrenadeLauncher:
{ statId: 'weaponKillsGrenadeLauncher',
basic: { value: 0, displayValue: '0' },
pga: { value: 0, displayValue: '0.0' } },
weaponKillsSuper:
{ statId: 'weaponKillsSuper',
basic: { value: 111, displayValue: '111' },
pga: { value: 0.6206896551724138, displayValue: '0.6' } },
weaponKillsMelee:
{ statId: 'weaponKillsMelee',
basic: { value: 171, displayValue: '171' },
pga: { value: 0.2413793103448276, displayValue: '0.2' } },
weaponBestType:
{ statId: 'weaponBestType',
basic: { value: 4, displayValue: 'Hand Cannon' } },
winLossRatio:
{ statId: 'winLossRatio',
basic: { value: 0.5263157894736842, displayValue: '0.53' } },
allParticipantsCount:
{ statId: 'allParticipantsCount',
basic: { value: 295, displayValue: '295' } },
allParticipantsScore:
{ statId: 'allParticipantsScore',
basic: { value: 2289, displayValue: '2,289' } },
allParticipantsTimePlayed:
{ statId: 'allParticipantsTimePlayed',
basic: { value: 159144, displayValue: '1d 20h' } },
longestKillSpree:
{ statId: 'longestKillSpree',
basic: { value: 7, displayValue: '7' },
activityId: '396878223' },
longestSingleLife:
{ statId: 'longestSingleLife',
basic: { value: 165, displayValue: '2m 45s' },
activityId: '785496327' },
mostPrecisionKills:
{ statId: 'mostPrecisionKills',
basic: { value: 9, displayValue: '9' },
activityId: '399344555' },
orbsDropped:
{ statId: 'orbsDropped',
basic: { value: 198, displayValue: '198' },
pga: { value: 0.5172413793103449, displayValue: '0.5' } },
orbsGathered:
{ statId: 'orbsGathered',
basic: { value: 6, displayValue: '6' },
pga: { value: 0.20689655172413793, displayValue: '0.2' } },
remainingTimeAfterQuitSeconds:
{ statId: 'remainingTimeAfterQuitSeconds',
basic: { value: 771, displayValue: '12m 51s' },
pga: { value: 25.103448275862068, displayValue: '0m 25s' } },
teamScore:
{ statId: 'teamScore',
basic: { value: 1058, displayValue: '1,058' },
pga: { value: 36.48275862068966, displayValue: '36' } },
totalActivityDurationSeconds:
{ statId: 'totalActivityDurationSeconds',
basic: { value: 35567, displayValue: '9h 52m' },
pga: { value: 538.551724137931, displayValue: '8m 58s' } },
combatRating:
{ statId: 'combatRating',
basic: { value: 145.41431649872487, displayValue: '145.41' } },
fastestCompletionMs:
{ statId: 'fastestCompletionMs',
basic: { value: 74800, displayValue: '1:14.800' },
activityId: '399194892' },
longestKillDistance:
{ statId: 'longestKillDistance',
basic: { value: 57, displayValue: '57.0' },
activityId: '473929361' },
highestCharacterLevel:
{ statId: 'highestCharacterLevel',
basic: { value: 20, displayValue: '20' } },
highestLightLevel:
{ statId: 'highestLightLevel',
basic: { value: 301, displayValue: '301' } } } }
Yes, its the same bug. We will deploy a fix on Monday.
@Tetron-bng Will we be notified when the fix goes live?
The fix is going live as we speak - try it it again at ~11am and let us know how it goes for you.
Okay, give it a go!
Not working for me, Destiny2.GetHistoricalStatsForAccount shows completely wrong amount of kills:
kills:
{ statId: 'kills',
basic: { value: 24547, displayValue: '24547' },
pga: { value: 40.708126036484245, displayValue: '40.7' } },
deaths seem ok, assists overblown too.
maciek, can you share the URL you were hitting (which will give us the account ID and other params you were passing in?)
Yeah, curl -H "X-API-Key: REDACTED" "https://www.bungie.net/Platform/Destiny2/2/Account/4611686018459911023/Stats/" I'm looking at Response.mergedAllCharacters.results
Sweet, taking a look now
@maciek134 What makes you think the values are too high? What are you comparing them to?
Previous data (https://imgur.com/a/itsqH) and destinytracker: http://destinytracker.com/d2/profile/psn/klh_js
Best guy on DTR has K/D of 3.28, API tells me I have 5.71 ;p
Hmm, taking a cursory look at it, it looks like there's a deleted character skewing the results - a deleted character whose values seem very incorrect. I don't believe it's related to this particular issue though - could you open a new issue and we'll take a look? We have some suspicions as to what's happening here, but I don't think it has to do with the issue above specifically.
Most helpful comment
Yes, its the same bug. We will deploy a fix on Monday.