Hi there o7
First time posting here - hope I’m in the right place.
I’m trying to fetch a list of market orders in public player-owned structures to use in my hauling tool, but I can’t find any way to enumerate them through ESI.
I read through Resolving Upwell Structure IDs and Resolving Structure Markets in the docs, and then tried fetching the full list of public structures from the /universe/structures/ endpoint, before fetching the orders using the /markets/structures/{structure_id}/ endpoint, however this resulted in a large number of 403 errors with the message "Market access denied" - quickly overrunning the error limit. I assume that’s from public structures that just don’t have market services but I’m not really sure - it would seem to make more sense to yield a successful 200 empty response [] if that were the case.
I also thought it might be possible to approximate a list of structures with public market access by loading all of the regional order lists and searching them for ranged buy orders from player-owned structures, but this seems like a bit of a roundabout way of doing it and would only work for structures that have ranged buy orders.
Is there any way to get all of the market orders available to the public (or to an authenticated character) in structure markets through the ESI?
Heya, I’m not sure about market orders, but i can share what i know about structures. My understanding of the 403 is that you’re not allowed to access that information, no matter if there’s a market or not. So I would treat that error as “i don’t have docking rights”, and I’m not allowed to know if there’s a market.
You already noticed the error limit. My suggestion is to track the response headers, and make sure you don’t exceed like 75% as you iterate over all the structures. The backfill will take time, but once you’ve done that and have a list that you should have access to, it will be much faster. Note that permissions can change any time. You may want to make sure your code can handle that.
Thanks for that Rihan! That is what a 403 should mean, but it doesn’t seem to be the case here. The structure IDs in question are pulled form the public endpoint which according to the docs means they have “a completely open Access Control List”.
I figured out there’s a filter option on that public structures endpoint to find only those structures that have market services (/universe/structures/?filter=market), which seems to avoid those errors.
The question remaining now is whether there’s a way to find the structures a character has access to through an ACL…