JavaScript is required to use Bungie.net

#programming

originally posted in:BungieNetPlatform
Edited by DystinctVertex: 4/13/2015 10:15:14 PM
2

Help with GetDestinyExplorerItems

How would one get a list of all armor and weapons in destiny in a JSON response which would include stats, type, bucket, rarity and icons? I am having trouble figuring this out with the GetDestinyExplorerItems call.
English
#programming #api

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

View Entire Topic
  • Edited by JerkLine: 4/14/2015 1:36:35 AM
    You can construct a query in the url, like: [url]https://www.bungie.net/Platform/Destiny/Explorer/Items/?count=100&page=0[/url] and then increment the page. A simple Python script with the python-requests library would look something like: [quote] import requests weapon_list = [] params = { 'buckets': ['PrimaryWeapon', 'SpecialWeapon', 'HeavyWeapon'], 'count': 100, 'page': 0 } json_response = requests.get('https://www.bungie.net/Platform/Destiny/Explorer/Items/', params=params).json() data = json_response['Response']['data'] weapon_list += data['itemHashes'] while data['hasMore']: params['page'] += 1 json_response = requests.get('https://www.bungie.net/Platform/Destiny/Explorer/Items/', params=params).json() data = json_response['Response']['data'] weapon_list += data['itemHashes'] [/quote] Forgive the awful formatting. Also, I don't know what the rate limits are and I didn't account for it in that script. Also I assume the item hashes are what you want.

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

    3 Replies
    You are not allowed to view this content.
    ;
    preload icon
    preload icon
    preload icon