Api: Is usage of specific weapons tracked and is the data available via the API?

Created on 11 Apr 2018  ·  10Comments  ·  Source: Bungie-net/api

Using the API, you can get the usage stats for each weapon category (weaponKillsHandCannon, weaponKillsSideArm, weaponKillsSubmachinegun, etc.), broken down into game category (patrol, raid, story, allStrikes, etc.), but can you retrieve usage stats for specific weapons using the API?

I know it can be done for Exotic items.

On Destiny Tracker, specific weapons have “PvP Weapon Insights” which lead me to believe each weapon is tracked individually, but I'm not interested in my PvP insights, only my PvE insights.

question

All 10 comments

Unfortunately, indeed it can only be obtained for exotic items unless you're going through the pains of scraping individual PGCRs. What Destiny Tracker has most likely done is that they've scraped every historical PGCR and performed their own custom aggregation using each PGCR's entries[].extended.weapons[] information. That's an intense amount of data to process, but it's the only way we currently expose weapon data other than the pre-aggregated exotic items weapon data.

So is the data simply not recorded by Bungie for PvE? I mean, there's no way that the API could potentially expose this information because it doesn't exist? Thank you very much for your reply.

Ah, so it is technically available for both PvP and PvE, but only on a per PGCR level. However, PGCRs are available for PvE activities, so you can get it! For instance, here's a Strike activity I played a while back:

https://www.bungie.net/Platform/Destiny2/Stats/PostGameCarnageReport/1256042097/

Under entries.extended.weapons, you can see some basic information for specific weapons.

The problem is that we don't have this data pre-aggregated: we only have it in its raw format, which is why sites like Destiny Tracker have to mine all of the PGCRs if they want to perform custom aggregation. It's less than ideal, but unfortunately this is the only way we'll be able to return this data for the forseeable future. You should hit up the Destiny Tracker folks, however: I could definitely picture a world where they (or other PGCR scrapers) could/may have already built an API on top of our API exposing the custom aggregations they're performing!

Charlemagne has this data from scraping PGCRs. Hit me up if you are interstd (check warmind.io for contact info). We may be able to provide this to you via an api.

Thank you, both! @TorKallon, I'm interested in getting as much data as I can on my PvE activities but particularly on my weapon usage – I'd very much like access to an API if you can grant me that <3

Awesome, indeed thanks @TorKallon ! I wish we provided a more flexible/custom aggregate-able set of data in our APIs, it'd just be a really big undertaking for us (particularly if we wanted it to be generic enough that it could serve needs other than the ones we originally had in mind) and I don't think we'll ever actually have the time and manpower to make it happen. Those of you doing custom pivots on this data are really doing incredible things, it blows my mind to see it!

How long are PGCRs retained for? Can I get all of my PGCRs for a single character and theoretically have a complete set of weapon usage data?

Yes indeed you can! PGCRs are retained indefinitely. Back in Destiny 1 there was a little hiccup in that, because we had to start storing less data about specific PGCRs... however, even though the contract started returning less data, we never outright removed any. So you should be able to get your full history - not just in D2, but D1 as well!

If you want it specifically for you, you can use the GetActivityHistory endpoint to get all of your PGCR IDs (grab the "referenceId" property on the DestinyHistoricalStatsActivity objects being returned), and then use that to make calls to the GetPostGameCarnageReport endpoint!

That's exactly what I've just tried and it gives me exactly what I'm looking for – I'm going to work on a way to parse and display the data.

Thank you so much to you both <3

Awesome! I'm glad it's working out!

Was this page helpful?
0 / 5 - 0 ratings