Bungie-net / api

Resources for the Bungie.net API
Other
1.21k stars 92 forks source link

How do I "GET" a list of items (weapons specifically) from the API? #1457

Closed ace51689 closed 3 years ago

ace51689 commented 3 years ago

I'm basically trying to get a JSON object of all legendary weapons in the game. My thought process being get an object of all items and filtering out all non weapons, then filtering out all non-legendary ones. Or maybe there's a way to just get all legendary weapons in one call? I've been able to mess around with getting Inventory Item Definitions and Plug Set Definitions, but I'm kinda stumped on how to just GET a list/object of items or weapons.

andyschott commented 3 years ago

You should use the manifest database for that. If you go through all of the rows in the table that contain inventory items, you can look at the json for each row, and then figure out the type of item, and if it's a legendary weapon, add it to your list.

ace51689 commented 3 years ago

Okay, but how do I use the manifest database? Lol I was looking into it but I wasn't sure where to start

andyschott commented 3 years ago

This wiki article is a good overview of how to get started: Obtaining Destiny Definitions "The Manifest".

ace51689 commented 3 years ago

Thanks for linking that article, I'm over that hump now. I am curious if you know why "GET"ting the current location of the static definitions doesn't require a api key? When I was passing it in my request I was getting a CORS error, and then when just pasted the url into my browser it loaded the whole object. That made me think of not passing the key and bam I got it all.

andyschott commented 3 years ago

No, I don't know why that is. Must be something to do with how Bungie implemented the server side of the API. Glad you were able to get it working!