API modification proposal and feedback

#1 - Dec. 22, 2012, 8:01 a.m.
Blizzard Post
Right now set items contain the ranks inside of an object looking something like this[1]. For some reason the set bonuses contain a "attributes" object but no "attributesRaw". This means anyone who wants to parse this data and extract the actual attribute mod needs to parsed through a localized string. My proposal is simple; add a attributesRaw here to prevent this burden on the API consumer. Right now I am going to be forced to just use the stats property because I don't have the time (nor do I want the library bloat) of localized string parsing of attributes.

On a side note, providing a aggregatedAttributesRaw property to the root level of a hero would also help very much. Players are interested in the unbuffed DPS, to do this they must parse each item and extract the modifiers and calculate them. Right now I make 15 requests to load a hero, 1 for the hero, then 14 times for each item because I need the raw attributes to calculate unbuffed dps. If they were included in the hero object it would be much easier to work with.

The current client I am working on is here[3] and I am open to any feedback if I am making this more complicated then it needs to be.

[1]

{ slug: 'natalyas-solace',
name: 'Natalya\'s Solace',
ranks:
[ { required: 2, attributes: { required: 2, attributes: [ 'Critical Hit Chance Increased by 7.0%' ] }},
{ required: 3, attributes: .. snip .. },
{ required: 4, attributes: .. snip .. } ],
items:
[ .. snip .. ] }


[2]

{ slug: 'natalyas-solace',
name: 'Natalya\'s Solace',
ranks:
[ { required: 2, attributes: { required: 2, attributes: [ 'Critical Hit Chance Increased by 7.0%' ], attributesRaw: [ 'Crit_Percent_Bonus_Capped' ] }},
{ required: 3, attributes: .. snip .. },
{ required: 4, attributes: .. snip .. } ],
items:
[ .. snip .. ] }


[3] https://github.com/cstockton/nodejs-lfger-d3
Forum Avatar
Battle.net Developer
#11 - March 6, 2013, 12:43 a.m.
Blizzard Post
The attributesRaw field for set bonuses has been present there for some time now. Here is an example:
http://us.battle.net/api/d3/data/item/CjkIp-jlhQ0SBwgEFVHw6GsdslfV7h34ucU_HdZmipQdDmt__R2Ivr4hHcJqmxEwCTivA0AAUBJgrwMYosHHvg1QAlgAoAHxsdXjDaAB-e2X2AKgAcCEs6EDoAHokMvhA6ABosHHvg0
Forum Avatar
Battle.net Developer
#13 - March 6, 2013, 9:01 p.m.
Blizzard Post
Thanks for the clarification, sorry about missing that other part.

We can look into including the hero's attributes and the equipped items' attributes into a raw data section inside the 'stats' object.

Furthermore, we'll see what we can do about providing the base damage/dps number (unmodified from any buffs/skills) as a value. This may remove the need to analyze all the raw data unless there are other examples or attributes that would be useful to calculate.