Bungie-net / api

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

[Question] Getting string names of items? #72

Closed danrspencer closed 6 years ago

danrspencer commented 7 years ago

I feel like I'm missing something fundamental with the API. I've been able to successfully get details of my profile, characters, items, etc... but I get nothing back but IDs. How do I translate these IDs into useful localised names?

iBotPeaches commented 7 years ago

That would be the Manifest - https://bungie-net.github.io/multi/operation_get_Destiny2-GetDestinyManifest.html#operation_get_Destiny2-GetDestinyManifest

  1. Hit endpoint.
  2. Use mobileWorldContentPaths.en property and download that file.
  3. Unzip the first entry, you will get a SQLite DB
  4. Loop all tables. These tables can be found with any blue badge named "Manifest" in documentation.
  5. Query for the items in each table like SELECT json FROM DestinyBondDefinition for example
  6. Decode that list of JSON blobs and there you have every entity with all those details, including name.
  7. You can index/cache/organize them how you want. I tend to do {type}-{hash}, but that is up to you.

If that is too complicated and/or not going to work in your use case, I would strongly recommended it as the alternative is the return of a single item manifest endpoint (#10) which delivery/eta is unknown.

vthornheart-bng commented 7 years ago

I definitely recommend grabbing the manifest for all but the most simple of use cases - but for such extremely trivial use cases, #10 will hopefully be deployed at some point next week!

I also still need to write a decent "getting started" guide that covers what the Manifest is vs. live data endpoints, how to set it up and such. That would definitely be useful for people first hitting the API!

floatingatoll commented 7 years ago

Be careful when recommending #10 as well - rate limiting + single-item definition queries will not go well for anyone with more than a certain amount of stuff, in D1 anyways.

On Fri, Sep 8, 2017 at 9:55 AM, Vendal Thornheart notifications@github.com wrote:

I definitely recommend grabbing the manifest for all but the most simple of use cases - but for such extremely trivial use cases, #10 https://github.com/Bungie-net/api/issues/10 will hopefully be deployed at some point next week!

I also still need to write a decent "getting started" guide that covers what the Manifest is vs. live data endpoints, how to set it up and such. That would definitely be useful for people first hitting the API!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Bungie-net/api/issues/72#issuecomment-328157882, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFqDEiKF3FbsCf7Dl3jg_xcyllSx7Y4ks5sgXGMgaJpZM4PQzzG .

EdgarVerona commented 7 years ago

Oh yeah - I definitely wouldn't recommend #10, I'm adding it by popular demand but I don't think it should be used for anything more than a learning tool, or some theoretical extremely trivial use case that I can't actually picture at the moment.

vthornheart-bng commented 6 years ago

I'm going to close this one for now, as the advice above should hopefully give a good starting point - let us know if you run into any troubles!

danrspencer commented 6 years ago

Yep, thanks for the help this got me back on track.