Location, Location, Location... and adding some context to the ids retreived from my api

Working on some code and I have a real pain of a situation in order to list some nice friendly names for the locations of stuff in corp assets.

  • Fly to and place a fairly unique item in corp hangar of Player Owned Structure.
  • Query API for corp assets
  • Locate said fairly unique item
  • Make a manual note of the location_id of the fairly unique item with some text I can see in-game in station which I flew to.

As you can imagine step one is a majassive PITA, and step 3 is a standard pita.
Can you help me figure out a better way?

(note: the location_id of an asset in a corp hangar is not the station_id)
(note2: I understand why things be like this, the hangar needs to be a different id, but that still doesn’t help me put some textual context against it)

I feel like I am missing something quite simple here, any stabs at helping me are much appreciated.

You might find Asset location_id quick reference | esi-docs quite helpful. Basically the asset endpoint returns a flat list that you need to parse up the tree to find the root location like in the example in the docs.

1 Like

Thanks for this, hard to beat a little recursion on the weekend :wink: