originally posted in:BungieNetPlatform
Take a look at the Explorer/Items endpoint help docs,
https://www.bungie.net/platform/destiny/help/HelpDetail/GET?uri=Explorer%2fItems%2f
While you can't get everything in one call, you can use the page param like Scapegoat uses.
Also, the buckets param is very helpful and allows you to pass in all the buckets you want, so,
http://www.bungie.net/Platform/Destiny/Explorer/Items/?buckets=PrimaryWeapon,SpecialWeapon,HeavyWeapon&count=500&definitions=true
would get you all the weapons, in groups/pages of 500 items each. so you'd want to add &page=1/&page=2 to each subsequent call until you have all the items.
As far as the stats, perks, etc... make sure you add &definitions=true to get the definitions with your calls so you'll know that Response->data->items->YourItem->statHash: "12345" links up with Response->definitions->stats->statHash "12345" and now you know that gun has a stat value for Stability or Damage or whatever
English
-
How would I translate the Hashes into an integer_
-
Hashes should always be cast as strings. You should not translate hashes to an integer as with most of the larger hashes, and most languages, you'll run into overflowing/rounding. Like with JS, I think if the hash was larger than 14 digits it would start rounding it causing all sorts of problems. "12345678901234567" became "12345678901234000" so always use a string. I also ran into an issue with just a user's character ID and a 3rd party JS lib, where passing params into it's ajax methods would force those strings to ints, got rounded, and messed things up. So I ended up just chunking some hashes coming from the front end into groups of 10... so for the previous number instead of trying to send "12345678901234567" I had to send a param like ["1234567890", "1234567"] and then on the server, if the param came in as an array, just concat it to a single value.
-
Edited by DystinctVertex: 4/14/2015 11:56:23 PMSorry I wasn't specific. Thanks for the information you provided, but how do I convert the hash (example 123456789) to the stat in a string form (example 123456789 to "Rate of Fire"). Also when I try using the types param I seem to be running into a syntax error what would be an example using the types parameter?
-
Ah sorry. So, currently when I try to hit Explorer/Items with types, i'm getting no results no matter which params I pass. I don't know if 1.1.2 is messing that up or what's going on? The url should look like: http://www.bungie.net/Platform/Destiny/Explorer/Items/?types=Weapon&definitions=true From https://www.bungie.net/platform/destiny/help/HelpDetail/GET?uri=Explorer%2fItems%2f : [quote]types Type of items to return: Currency, Armor, Weapon, Bounty, CompletedBounty, BountyReward, Message, Engram, Consumable, ExchangeMaterial, or MissionReward. Omit for all types.[/quote] And if you're just using types, you may have to use &bucketsortypes=true but since I can't get any results currently, I haven't been able to test that. [quote]bucketsortypes True if items can match either the supplied buckets or the supplied item types.[/quote] So, when you do get the call to work, you'll get a JSON data response back. Since you passed &definitions=true, you'll get two chunks of data back in your call. Quick pseudocode here... basically what you'd want to do is loop over Response->definitions->items. The item might look like: [quote] "4144666151": { "itemHash": 4144666151, "itemName": "Abyss Defiant", "stats": { "368428387": { "statHash": 368428387, "value": 272, "minimum": 272, "maximum": 331 } } } } [/quote] bah.. it's not going to be nice and format that properly. So... var myItem = Response -> definitions -> items -> "4144666151"; Then you'd want to loop over the stats in that item var myStatHash = myItem->"stats" -> "368428387"->statHash // which is just that 368428387 number To resolve that hash... look at Response->definitions->stats [quote] "368428387": { "statHash": 368428387, "statName": "Attack", "statDescription": "Higher Attack allows your weapons to damage higher-level opponents.", "icon": "/img/misc/missing_icon.png", "statIdentifier": "STAT_DAMAGE", "interpolate": false }, [/quote] var myStatName = Response->definitions->stats-> myStatHash->statName
-
Is anyone else having this problem... I can't get buckets or types to work with the Explorer Items. Is the API broke? Whats going on?