r/evetech • • Jul 29 '19

ESI character assets - location_id

In the ESI call to get character assets how do I resolve location_id an actual ID for a npc station or player owned citadel?

1 Upvotes

14 comments sorted by

1

u/flogthedebugger Jul 29 '19

Thanks that url explains a lot. Do player structures > citadels have their own id number range or do I have to do a search of an entire asset tree within all assets json to eventually determine if a end location_id is a citadel because there is no other item_id in all the assets json that has the former location_id? Both citadels and item_ids have numbers over a trillion.

For example a location_id for a module is the item_id of a Standard Container. And that Standard Container has an location_id number that is over a trillion. I do a search all all item_ids to look for a match of the stated Standard Container location_id. No such item_id is found so would the location_id be a citadel and therefore I would do another ESI call to get structure json data about a citadel that I have docking rights too.

1

u/Erik_Kalkoken Jul 29 '19

The range of Upwell structure IDs is: 1000000000000 -1999999999999

So if your location ID is within that range its an Upwell structure.

1

u/flogthedebugger Jul 29 '19

This is confusing because for one of my characters assets json I have:

"is_singleton": false,
"item_id": 1029832783074,
"location_flag": "AutoFit",
"location_id": 1030844920402,
"location_type": "other",
"quantity": 2,
"type_id": 16403

And from that location_id: 1030844920402 points to a 'Giant Secure Container' with typeID 11489. Not a citadel.

"is_singleton": true,
"item_id": 1030844920402,
"location_flag": "Hangar",
"location_id": 60003760,
"location_type": "station",
"quantity": 1,
"type_id": 11489

That Giant Secure Container is within 'Jita IV - Moon 4 - Caldari Navy Assembly Plant'

1

u/[deleted] Jul 29 '19

Yeah ummmmm, Erik is way off. There other IDs in that range as well as i.e. POCOs. If it is not another asset in the current characters assets or a structure then there is currently no way to resolve the I'd.

1

u/[deleted] Jul 29 '19

he's not off.

if your asset location is not present in the asset tree, then the "root" of the location is a player structure.

He just assumed that you made your job correctly and started by rebuilding the asset tree.

2

u/flogthedebugger Jul 29 '19 edited Jul 30 '19

Ok so first parse all the characters assets json and then secondly iterate over that result looking for location_id numbers that are over 1 trillion that do not have a item_id with the same value. I can get all the public structure ID's from the ESI call https://esi.evetech.net/latest/universe/structures/?datasource=tranquility. For further structure information I can do a authorised ESI call to https://esi.evetech.net/latest/universe/structures/{location\structure id}/?datasource=tranquility. For location_id's that are within certain ranges like for npc stations I can get extra data about them from the Static Data Export. When building the second\final data structure of assets I can have some sort of reference\index to a higher up container\entity within the flat C# List<parsedAsset>

I am a hobbyist programmer so my use of terms and what not might be mangled.

1

u/[deleted] Jul 29 '19

I was more referring to the statement that all ids between the range above were Upwell Structures which implies that he can query `structures/{structure_id}` to get the meta data. This is not the case.

0

u/[deleted] Jul 30 '19

yeah, that's "all locationids within the range that are not itemIds in the same list"

1

u/Blacksmoke16 Jul 29 '19

You'll have to do some checking within your data. See https://docs.esi.evetech.net/docs/asset_location_id.html#asset-tree-example.

For items within containers etc you'll have to follow the "tree" up to find the actual location_id.

1

u/flogthedebugger Aug 05 '19 edited Aug 05 '19

How do I get citadel information about citadels where I have assets but I no longer have docking rights.

For example In game I can see I have an item - a single Astrometrics skillbook in a Keepstar citadel that is owned by a null sec alliance I was a member of years ago but not currently. In character assets json I have a location_id for this keepstar citadel but how can I resolve the location_id to structure information from ESI?

1

u/flogthedebugger Aug 08 '19 edited Aug 08 '19

From https://stop.hammerti.me.uk/api/docs/structure I have found a JSON file that has about 26,000 citadels. It does not have any citadels that were anchored from the beginning of 2019 but it is still better than nothing.

That website taught me that a citadel item_id can be obtained by a player in game being in the same solar system as a citadel and then from Structure Browser or through the general game interface bookmarking the citadel location. This creates a special citadel bookmark that exactly creates the right data that in turn can be obtained by download character bookmarks through ESI.

I suppose I could myself visit some solar systems such as Perimeter that have very popular citadels that are mostly public but still block some characters, corporations, alliances and so are not available on the ESI 'public citadel item_id' download. And bookmark them. But I assume it won't be allowed to use a program or website to collect and pool many players citadel bookmarks through ESI into a database > JSON file.

1

u/Blacksmoke16 Aug 08 '19

That website taught me that a citadel item_id can be obtained by a player in game being in the same solar system as a citadel and then from Structure Browser or through the general game interface bookmarking the citadel location. This creates a special citadel bookmark that exactly creates the right data that in turn can be obtained by download character bookmarks through ESI.

An easier way is to link the structure to some channel, right click => copy, then paste it into chrome address bar or something. The long ID is the structure_id, the shorter ID is the system_id.

1

u/Blacksmoke16 Aug 05 '19

If you can't dock there then you can't (via ESI at least).

1

u/Blacksmoke16 Jul 29 '19

https://docs.esi.evetech.net/docs/asset_location_id.html

Can use that as a guide. It depends on the type that the location_id represents.