ESI - get structure market data from structure name has some code that takes the name of a Station input into Slack and fetches market data about that station. It does this by:

  1. Using the search resource to get the id of the station
  2. Using the station resource to get the id of the constellation
  3. Using the constellation resource to get the id of the region
  4. Using the market resource to get data about the market
  5. Filtering that data down to just data about the station id

I’d love to do the same for structures (and it looks like I could cut out steps 2 and 3 for structures as you can fetch the market data directly from a structure id), but I can’t figure out a way to get from the structure name to the structure id.

Suggestions? My current best idea is to cache the public list of structures and work off that.

Side question: do structure names have to be unique? Do they have to be unique from station names?

Yerh, only way I can think of is caching all the structures and I don’t think structure names are unique (as they’re unique via the locationID), but, it’s not something I know for sure. Structure names does include the system name, though, so, collisions will be rare and always be in the same system.

If you’re getting all structures it may be worth using: (more specifically:

This topic was automatically closed after 90 days. New replies are no longer allowed.